I'm trying to monitor log files using Posix expressions with following item, and it works ok:
Type: Zabbix agent (active)
Type of information: Log
Key: log[example.log,[[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}]
When I try to retrieve several consecutive lines using a more complex regular expression like the one in this key:
log[example.log,[[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}.*\nERROR.*\nFAIL]
it doesn't work even if it is a Posix regular expression.
This regular expression has been tested with zabbix_sender command. Following command works ok on client system, it extracts lines I'm looking for:
/usr/local/sbin/zabbix_sender -z <zabbix_server> -p 10051 -s <hostname> -k trap-item -o "`/bin/grep -P "[[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}.*\nERROR.*\nFAIL" example.log`"
Type: Zabbix agent (active)
Type of information: Log
Key: log[example.log,[[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}]
When I try to retrieve several consecutive lines using a more complex regular expression like the one in this key:
log[example.log,[[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}.*\nERROR.*\nFAIL]
it doesn't work even if it is a Posix regular expression.
This regular expression has been tested with zabbix_sender command. Following command works ok on client system, it extracts lines I'm looking for:
/usr/local/sbin/zabbix_sender -z <zabbix_server> -p 10051 -s <hostname> -k trap-item -o "`/bin/grep -P "[[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}.*\nERROR.*\nFAIL" example.log`"
Comment