Yelp / elastalert

Easy & Flexible Alerting With ElasticSearch
https://elastalert.readthedocs.org
Apache License 2.0
7.99k stars 1.74k forks source link

Painless script not working ... #3242

Closed ernestoalejandrocu closed 2 years ago

ernestoalejandrocu commented 2 years ago

i have this section of config on my spike rule, but not working for me, any body can help me to solve this.

metric_agg_key: scripted-metric
metric_agg_script:
    script: "doc[\"jolokia.jvm.memory.heap_usage.max\"].value - doc[\"jolokia.jvm.memory.heap_usage.used\"].value"

i get this error...

unsupported operand type(s) for +=: 'int' and 'NoneType'

nsano-rururu commented 2 years ago

https://github.com/Yelp/elastalert/pull/2759

ernestoalejandrocu commented 2 years ago

@nsano-rururu hi buddy, sorry for my bad english, the https://github.com/Yelp/elastalert/pull/2759 means that i had to use elastalert2 or simply upgrade from master? explain me please, or if i must do another thing about it. Thanks

nsano-rururu commented 2 years ago

2759 pull request should have been merged into elastalert2

nsano-rururu commented 2 years ago

Please close

ernestoalejandrocu commented 2 years ago

Hi @nsano-rururu, first, thanks for the upgrade recommendation to elastalert2, now in this moment i want to do the next with not success. I need get two fields (jolokia.jvm.memory.heap_usage.max and jolokia.jvm.memory.heap_usage.used) and substract them, to obtain the amount of jvm memory free. How can i do it, if my sample if wrong, please help me, i dont know if a need another type of rule o simply fix my method ....

#################### name: Alerta - Incremento del consumo de Heap en la JVM type: spike_aggregation index: "metricbeat-7.17.1-*" doc_type: _doc filter:

Thanks again @nsano-rururu ......

waiting ....

nsano-rururu commented 2 years ago

Why don't you ask a question with the disccussion of elastalert2. https://github.com/jertel/elastalert2/discussions

ernestoalejandrocu commented 2 years ago

not have idea of this way, a going to post my need there, thanks.