Reputation: 19
I'm trying to remove image load urls from the logs when parsing them, but i've tried the below and it doesn't work:
if [message] !~ "*.(jpg|jpeg|gif)" {
drop {}
}
So for example the below:
[domain]/home/home.do
[domain]/home/home2.do
[domain]/home/image.jpg
[domain]/home/test.do
[domain]/home/image.gif
I want to be filtered down to:
[domain]/home/home.do
[domain]/home/home2.do
[domain]/home/test.do
Thanks
Upvotes: 0
Views: 149
Reputation: 217564
The correct regular expression looks like this: (+ you need to use =~
instead of !~
since you want to drop images only if they match the regular expression)
if [message] =~ "\.(jpg|jpeg|gif)$" {
drop {}
}
Upvotes: 2