How can we do our own calculations through mappings? I've try this configuration but I get an error:
PUT nameIndex/_mapping
{
"runtime": {
"cpuIndex": {
"type": "long",
"script": {
"source": "emit(doc['system.cpu.cores'].value + doc['system.cpu.system.pct'].value) / doc['system.cpu.cores'].value)"
}
}
}
}
jbudz
(Jon Budzenski)
August 6, 2021, 6:16pm
2
Can you share what error you're getting?
stephenb
(Stephen Brown)
August 6, 2021, 9:59pm
3
Hi @NoobUser404
Well for 1 you have a syntax error and extra )
here doc['system.cpu.system.pct'].value)
<!---
Also I am not sure if that is just a sample calc but it really does not make sense adding the normalized CPU % to the number of cores.
3rd that will probably result in a double and you have a long
defined
system
(system)
Closed
September 3, 2021, 10:00pm
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.