I am trying to process Nagios performance data to ELK using logstash, I am receiving Nagios performance data format below, need to process and update it to the Elastic index.
I am able to view data in elastic index and filter with check_type, hostname etc. But I need to split performance data after the | ('total'=8.93GiB;;; 'used'=4.80GiB;;; 'free'=4.13GiB;;;") and write it into something like below
Nagios performance data format is like this:
current value with Unit;Warning value;Critical Value;Min value;Max value
e.g. here. total= 8.93 is the current value and Unit is GiB and there is no warning and critical value here
so, I need to process the all perf data and write it into the index like this.
Trying something like this without calling perl script: Convert Nagios perfdata string to JSON | Philippe Lewin. By doing this I will be able to write condition based on the value and alert it.
######################
[
{
"value": 8.93,
"min": "null",
"label": "total",
"uom": "GiB",
"warning": null,
"max": null,
"critical": null
},
{
"value": 4.80,
"min": "null",
"label": "used",
"uom": "GiB",
"warning": null,
"max": null,
"critical": null
},
{
"value": 4.13,
"min": "null",
"label": "total",
"uom": "GiB",
"warning": null,
"max": null,
"critical": null
}
]
Hi Badger, thanks for the response. Data is dynamic, it will not be always the one I just gave an example. So, is there anyway to execute perl script in logstash and output should be written into index etc. I am looking for something in this blog Convert Nagios perfdata string to JSON | Philippe Lewin .
e.g. perl perfdatatojson.pl "rta=0.038000ms;5000.000000;5000.000000;0.000000 pl=0%;100;100;0"
so, if I can execute the perl script in logstash, I just need to pass performance data as a input to the script, which should write into a index.
Note: Performance output will be like this format. current value with Unit;Warning value;Critical Value;Min value;Max value. In this format there may be even 10 items or more than that which I need to run it through iterations and format it. In this case perl script will take care of iterations, I just need to pass it as a input.
Thanks,
Ranjith.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.