Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contains_i not recognized as valid #4165

Open
Cat22 opened this issue Feb 7, 2020 · 10 comments
Open

contains_i not recognized as valid #4165

Cat22 opened this issue Feb 7, 2020 · 10 comments

Comments

@Cat22
Copy link

Cat22 commented Feb 7, 2020

:msg, contains_i, "qt" /var/log/qt.log

Expected behavior

according to documentation this should work

Actual behavior

rsyslogd: error during parsing file /etc/rsyslog.conf, on or before line 93: invalid character ':' - is there an invalid escape sequence somewhere? [v8.39.0 try http://www.rsyslog.com/e/2207 ]

Steps to reproduce the behavior

insert this line in /etc/rsyslog.conf and run rsyslogd -N 1
:msg, contains_i, "qt" /var/log/qt.log

Environment

  • rsyslog version:
  • platform:
  • for configuration questions/issues, include rsyslog.conf and included config files

rsyslogd -v

rsyslogd 8.39.0, compiled with:
PLATFORM: x86_64-suse-linux-gnu
PLATFORM (lsb_release -d):
FEATURE_REGEXP: Yes
GSSAPI Kerberos 5 support: Yes
FEATURE_DEBUG (debug build, slow code): No
32bit Atomic operations supported: Yes
64bit Atomic operations supported: Yes
memory allocator: system default
Runtime Instrumentation (slow code): No
uuid support: Yes
systemd support: Yes
Number of Bits in RainerScript integers: 64

@davidelang
Copy link
Contributor

davidelang commented Feb 7, 2020 via email

@Cat22
Copy link
Author

Cat22 commented Feb 7, 2020

rsyslog.txt
I don't believe its a prior line because if i change contains_i to contains then rsyslogd -N 1 reports no errors, if i change it back to contains_i it reports the error again.
Note: I had to rename the file because git hub doesn't allow me to upload a conf file or even a gzip'd file (sounds like a windows thing sadly...)

@Cat22
Copy link
Author

Cat22 commented Feb 13, 2020

So, just to follow up for anyone else reading this (Thanks David Lang for all your offline help):
It turns out that the openSuse version of rsyslog is apparently broken (bug to be filed).
contains_i doesnt work in :msg or $msg format but it does work in the if/then format
e.g:
This doesnt work
:msg, contains_i "txt to match' /var/log/junk.log
but this does
if ( $msg, contains_i "txt to match' ) then /var/log/junk.log

ps: use rsyslogd -N 1 to check your config file(s)

@davidelang
Copy link
Contributor

davidelang commented Feb 13, 2020 via email

@Cat22
Copy link
Author

Cat22 commented Feb 21, 2020

Please also see this bug report:
https://bugzilla.suse.com/show_bug.cgi?id=1163602

@rgerhards
Copy link
Member

If I read correctly, contains_i is not supported in property based filters, only expression ones.

So you may consider changing to that

If $msg contains_i "..."

@rgerhards
Copy link
Member

@davidelang
Copy link
Contributor

davidelang commented Feb 21, 2020 via email

@rgerhards
Copy link
Member

rgerhards commented Feb 22, 2020 via email

@traveller42
Copy link

I hit this issue as well by following the text in the documentation for property filters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants