Hi,
Please some one help me how to drop lines using filebeat. My code is,
processors:
- drop_event:
when:
contains:
message: ["AbstractLoggingWriter", "WARN"]
and
processors:
- drop_event:
when:
contains:
message:
- AbstractLoggingWriter
- WARN
and
I'm getting both logs :
2019-01-24 08:08:30,291 WARN OSS com.pronto.util.CacheErrorMessage.getMessage(CacheErrorMessage.java:97) - Error Message id - ' wisp id : 16, franchisee id : 1527577560571, location id : 1527592878683, messageCode : CustomerFUPInfo' is Null.
2019-01-24 07:47:18,912 ERROR stderr org.jboss.stdio.AbstractLoggingWriter.write(AbstractLoggingWriter.java:71) - In TemplateProvider.locate()
2019-01-24 07:47:18,912 ERROR stderr org.jboss.stdio.AbstractLoggingWriter.write(AbstractLoggingWriter.java:71) - DD.ServiceClass: org.apache.soap.providers.StatelessEJBProvider
By using above code I'm unable to drop_lines containing.
But If I try to below :
processors:
- drop_event:
when:
contains:
message: "AbstractLoggingWriter"
drops all the messages containing AbstractLoggingWriter . I want to block or drop lines containing AbstractLoggingWriter and WARN . Please some one help me.
Thanks.
Hello @balamelangi ,
Use this to exclude lines
exclude_lines: ['AbstractLoggingWriter ']
@robscott27 You are awesome!!!!!
I followed your example for the nginx config file at
/usr/share/filebeat/module/nginx/access/config/nginx-access.yml
Added this last line to the bottom
type: log
paths:
{{ range $i, $path := .paths }}
- {{$path}}
{{ end }}
exclude_files: [".gz$"]
exclude_lines: ['.*feedback.*']
And now it works as expected!!!! Thank you so much!! Wish I would have found that post earlier! Have been beating my head against the wall for days.
Hope this works for you
Regards
Shrikant
Thanks for your reply @shrikantgulia .
I'm using 5.6.14 version filebeat. So, I think exclude_lines option is not working.
processors:
- drop_event:
when:
contains:
message: "AbstractLoggingWriter"
The above one is working. But coming to drop two different words not working. If you know please let me.
Thanks.
@adrisr can you please help me.
I'm trying to drop events with multiple words like :
AbstractLoggingWriter and WARN.
Thanks.
@balamelangi
can you please add array.
like ["AbstractLoggingWriter", "WARN"]
@shrikantgulia
Already I tried :
like ["AbstractLoggingWriter", "WARN"] is not working.
Even AbstractLoggingWriter also not droping.
Thanks.
adrisr
(Adrian Serrano)
January 24, 2019, 11:43am
9
What you want is to use "and" in your condition:
processors:
- drop_event:
when:
and:
- contains:
message: AbstractLoggingWriter
- contains:
message: WARN
This will drop all events that contain AbstractLoggingWriter and WARN at the same time.
1 Like
balamelangi
(Bala Melangi)
January 24, 2019, 12:06pm
10
@adrisr
No. I want WARN and AbstractLoggingWriter is separate logs. Not bot are in one line.
Thanks.
system
(system)
Closed
February 21, 2019, 12:06pm
11
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.