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!

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...