Splunk Search

How to filter events with regex?

pjanssen007
Explorer

I'm trying to filter out events like the ones below using the regex expression

regex _raw!="^[A-Za-z0-9]{4}:.*$"

 

but its not working.  Can someone help me with this?

 

Events

0000: 00 025e 28:0a000c5f call 0a000c5f

0000: 04 025d 14 ldnull

007a: 00 021d de:2a leave.s :0000=>01 0249 11:07 ldloc.s 07

Labels (1)
0 Karma
1 Solution

pjanssen007
Explorer

When I included the | the regex expression worked

| regex _raw!="^[A-Za-z0-9]{4}:.*$"

What function does | perform?

View solution in original post

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @pjanssen007,

could you better describe what you mean with " its not working"

Anyway, please try this:

| regex _raw!="[A-Za-z0-9]{4}.*$"

 Ciao.

Giuseppe

0 Karma

pjanssen007
Explorer

When I included the | the regex expression worked

| regex _raw!="^[A-Za-z0-9]{4}:.*$"

What function does | perform?

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @pjanssen007,

regex is a command stats must be located after a pipe.

Does it runs?

Ciao.

Giuseppe

0 Karma

pjanssen007
Explorer

Yes, it works correctly now.  Thanks for your help.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @pjanssen007,

good for you, see next time!

Please accept one answer for the other people of Community

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

0 Karma

pjanssen007
Explorer

By not working I mean I don't get any results.

0 Karma
Get Updates on the Splunk Community!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...