HI,
In the below event example
7/8/2021 12:21:17 PM 111C PACKET 0000020BF8B054E0 UDP Snd xx.xx.xx.xx d6b8 R Q [8085 A DR NOERROR] AAAA (13)PC-3QZT282-D(7)system(2)us(0)
7/8/2021 12:21:17 PM 111C PACKET 0000020BF8B054E0 UDP Snd xx.xx.xx.xx d6b8 R Q [8085 A DR NOERROR] AAAA (13)PC-3QBVQ11-D(7)maintenance(2)us(0)
I am trying to have a regex that would exclude the first entry from being indexed. Below is the config i have
props.conf
[Test:system] TRANSFORMS-null = setnull
transforms.conf
[setnull]
REGEX = .+system.+
DEST_KEY = queue
FORMAT = nullQueue
After restarting splunk on the heavy forwarder, it still indexes the first event with system in the event.
Please assist. Thanks
I have tested this config on my test instance and seems to work perfectly for me.
Are you able to advise if there are any important details you may have missed about the set-up?
Or, can you provide more detail on what your source logs look like? - perhaps provide some more examples?
@osasfrancis - Sorry, I miss read your question.
looking more into this, it seems like what you have should be working.
In your props you have [Test:system] does this match the sourcetype of the events you are trying to filter?
Yes. It does match.
Hi @osasfrancis
When you use the nullQueue the event matches with REGEX will be sent to nullQueue meaning they won't be ingested. In your case you wanted to retain event-1 and discard event-2 hence as @MKozanic updated REGEX matches the second event that would be discarded if that is the unique pattern (.+maintenance.+).
---
An upvote would be appreciated if this reply helps you!
If I read your question correctly AND if your second line is consistent - you could try this instead:
transforms.conf
[setnull]
REGEX = .+maintenance.+
DEST_KEY = queue
FORMAT = nullQueue
FYI - regex101.com is your best friend for these sorts of issues:
https://regex101.com/r/HSimiN/1