Ad Widget

Collapse

Extracting values from logs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pzabb6
    Junior Member
    • Apr 2009
    • 5

    #1

    Extracting values from logs

    Line in Log file

    2009-06-11 05:58:43,687 INFO EIDCACHE - q=0 000776CEIDKEY 539599

    is there any way of extracting the value 539599 from each line of the log so that i'd be able to set a trigger to alert if the value is greater than 700000?

    Either using a regular expression or other solution?

    Thanks
  • sirivias
    Junior Member
    • Oct 2008
    • 1

    #2
    1) Write a script to parse out the value you need, then have zabbix call that script.
    something like
    tail -n 20 log_file | grep "INFO EIDCACHE" | tail -n 1 | awk '{print $NF}'
    Store this result in zabbix with whatever frequency you desire.
    Set an alert when the last value > 70000

    2)create your own log with just those values, and have zabbix monitor that log.

    3)But best would be to create the key as a zabbix_sender key
    then run a script that watches for the value you want - and calls zabbix_sender to send the data point to the server.

    Comment

    Working...