I'm setting up audit log configurations, and I'm wondering if it's possible to not log events based on the contents. Here's an example of a log I'm trying to prevent:
I don't want the logs to record when the principal is elastic, or the origin_address is 127.0.0.1. Is it possible to configure the audit logs this way, or does anyone have a clever work around?
I have a same problem, trying to apply filter in my logs but I don't now why elasticsearch run without using configuration. in my elastic configuration I active: xpack.security.enabled: true xpack.security.audit.enabled: true xpack.security.audit.outputs: [ index, logfile ] xpack.security.audit.logfile.events.emit_request_body: true --------------------------------------------------------------------------------------------
and in my I trying lot of stuff and nothing change in my logs x-pack/log4j2.properties: -------------------------------------------------------------------------------------------- # MY RULES appender.audit_rolling.filter.regex.type = RegexFilter appender.audit_rolling.filter.regex.onMatch = DENY #appender.audit_rolling.filter.regex.regex = .principal=._xpack_security. appender.audit_rolling.filter.regex.regex = .principal=[_xpack_security]. appender.audit_rolling.filter.regex.onMisMatch = ACCEPT --------------------------------------------------------------------------------------------
That Regular Expression doesn't match what you're expecting it to. [ and ] have special meaning in a regular expression - you'll need to escape them in the properties file.
(\ desapeared when I saved my comment I need to put \\ and \* !)
Yes it's true, in reality the correct line I put was:
appender.audit_rolling.filter.regex.regex = .principal=\[_xpack_security\].
This would be remove all the line in the log file with " principal=[_xpack_security]" expresion
I tried to last week: #appender.audit_rolling.filter.regex.regex = .*principal=.kibana...action=.cluster:monitor.*|.*action=.cluster:admin.*|.*indices=..kibana.,.*|.*indices=..*.,.*
Didn't work to.
I don't now whats wrong with my filters or config...
With a log of trial and error I think I've gotten it figured out. I could have sword I tried this combination last night, but it seems to be working now so I must have messed something up if I did:
This works for me on elastic 5.6.1. I found that if you include a space between around the | it will cause the patterns to not match correctly, which is probably what I was messing up.
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.