elastalert icon indicating copy to clipboard operation
elastalert copied to clipboard

Using Environment variables in ElastAlert

Open prateekk1709 opened this issue 8 years ago • 0 comments

Hi. I am trying to implement alerts on my data present in elasticsearch using ElastAlert. I would like to know that is there a way we can use environment variables or properties file or by exporting the values for changing the fields present in rule types in ElastAlert instead of going and changing the values manually in the rule files to reduce error possibility. For example, My spike rule configuration looks like this:

name: Event spike type: spike index: alerting-logs-* threshold_cur: 300 timeframe: minutes: 2 spike_height: 2 spike_type: "up" query_key: HostName filter:

  • query: query_string: {query: 'smcfsloglevel:ERROR'} alert:
  • "email" email:
  • "[email protected]"

Now if I want to change the value of 'threshold_cur' from 300 to say 500 can I somehow do it without going to the spike rule file like by exporting like threshold_cur: ${thr_cur}

Does anyone have an idea to achieve this. Thank you.

prateekk1709 avatar Feb 07 '18 11:02 prateekk1709