[ZBX-10920] regexp included '\t' does not work properly Created: 2016 Jun 20  Updated: 2017 May 30  Resolved: 2016 Jun 20

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 3.0.1
Fix Version/s: None

Type: Incident report Priority: Minor
Reporter: Hideto Tange Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

RHEL 6


Issue Links:
Duplicate
duplicates ZBX-3924 frontend and daemons use different re... Closed

 Description   

logrt with regexp parameter include '\t' dose not work.
For example, in log file:
2016-06-20 10:00:00\tERROR\tError message
2016-06-20 10:00:00\tINFO\tError message
regexp pattern:
^[0-9- :]\tERROR

logrt["/path/to/logfile", "^[0-9- :]\tERROR"]

I expect that Error log only recorded to history_log table. But no log is recorded.



 Comments   
Comment by richlv [ 2016 Jun 20 ]

zabbix daemons only support posix extended.

Comment by Aleksandrs Saveljevs [ 2016 Jun 20 ]

In addition to the above, you are probably missing a quantifier like * or + after [], so closing as "Won't fix". You are welcome to discuss issues like these at https://www.zabbix.org/wiki/Getting_help .

Comment by Hideto Tange [ 2016 Jun 20 ]

This "^[0-9- :]\tERROR" is my mistake.
I specified "^[0-9- :]+\tERROR". But the log is not recorded.

When regexp is "^[0-9- :]+.ERROR" (. instead of \t), the log "2016-06-20 10:00:00\tERROR\tError message"
is recorded.

Comment by Aleksandrs Saveljevs [ 2016 Jun 20 ]

In your regular expression, there is another mistake: "-" should be either the first or the last symbol in a [] group.

You can try the following as a workaround for \t:

^[0-9: -]+\sERROR
Comment by Hideto Tange [ 2016 Jun 20 ]

Yes. "-" should be the first or the last.

And I try to user \s, it work well as a workaround.
Thank you for your suggestion.

Generated at Mon Mar 31 05:04:19 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.