elastalert icon indicating copy to clipboard operation
elastalert copied to clipboard

Filter to compare two fields of the same index

Open joaoantoniopereira opened this issue 9 years ago • 3 comments

Hi,

Is there a filter option to compare the values of two fields of the same index? I would like to trigger an alarm when used_disk > 0.9*total_disk.

Best regards, João

joaoantoniopereira avatar Apr 18 '17 12:04 joaoantoniopereira

You can achieve this functionality by using the metric_aggregation rule type. If you are using metricbeat or similar to gather the system information, you should use the 'percentage used' metric (system.filesystem.used.pct).

The example and docs go into detail on how to achieve this.

aidan- avatar Apr 18 '17 23:04 aidan-

Thank you so much. I was using marvel to get system data. I did not know metricbeat.

joaoantoniopereira avatar Apr 19 '17 12:04 joaoantoniopereira

@aidan- I have metrics named node_stats.fs.total.free_in_bytes and node_stats.fs.total.total_in_bytes, how can I calculate the % of disk available using elastalert using those two metrics?

like this: (node_stats.fs.total.free_in_bytes/node_stats.fs.total.total_in_bytes) * 100 would give me the percentage. Is there a query to do this?

balusarakesh avatar Feb 19 '20 00:02 balusarakesh