-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Scripted field returns the wrong value from metricbeat #23525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The strange fact is if I create my visualization over the "cpu stats" search, the answer is correct! |
I'm wondering this could be a bug with |
Hi again, I've found out why the visualization works with the "cpu stats" and not the metricbeat index itself. { The search filters if there is no value for the field and do not set it to value 0. I think This is not a bug on elasticsearch/ kibana. But metric beat should warn the users that this can happen using the script fields over the index itself. |
@jpountz Were you ever able to confirm your hypothesis? |
This was #29286, prior to 6.4 the script would return a default value, which was impacting the aggregated denominator. This is different behavior between the avg agg, which would ignore such docs and the scripted avg agg which would return the default value. From 6.4 on, users must explicitly check for existence of any values. |
Elasticsearch version: 5.0
Plugins installed: []
JVM version: 1.8
OS version: CentOS
Description of the problem including expected versus actual behavior:
The scripted field return wrong value.
Steps to reproduce:
1.Have metricbeat running.
2.Create a script field from the field "system.cpu.idle.pct" from teh management tab:
doc['system.cpu.idle.pct'].value
3. Create a line chart visualization on the metricbeat with two Y Axis.
- the field "system.cpu.idle.pct"
- the scrtipted field doc['system.cpu.idle.pct'].value
4. The results linecharts should be the same but they are totally different.
Provide logs (if relevant):
Here is the results: you can compare them:
@timestamp per 30 seconds Average system.cpu.idle.pct Average total_used_cpu_pct
March 9th 2017, 15:43:00.000 --- 0.771 --- 0.01481
March 9th 2017, 15:43:30.000 --- 0.762 --- 0.01471
March 9th 2017, 15:44:00.000 --- 0.762 --- 0.01471
March 9th 2017, 15:44:30.000 --- 0.769 --- 0.01484
March 9th 2017, 15:45:00.000 --- 0.76 --- 0.01465
March 9th 2017, 15:45:30.000 --- 0.774 --- 0.01493
March 9th 2017, 15:46:00.000 --- 0.761 --- 0.01468
March 9th 2017, 15:46:30.000 --- 0.767 --- 0.01479
March 9th 2017, 15:47:00.000 --- 0.76 --- 0.01465
March 9th 2017, 15:47:30.000 --- 0.768 --- 0.01482
and here is the script it is sending:
The text was updated successfully, but these errors were encountered: