Splunk Search

Extract Field Issue, but when using in a search.

kgs
Loves-to-Learn

My goal is to match whatever is after "Commit Description:" up until but not including the " after TASK0123456. I don't want to match the specific TASK[0-9]*, just whatever someone enters in a Palo Alto commit description. 

I am using the following regex string and it shows to match fine in the regex query field extraction page.

 

(?<=Description:\s)(?P<pansys_commitdes>\w+)

 

However, my issue is when doing a search in Splunk, the field shows up and seems to work correctly...until I use it in a search. My goal is to effectively look for pansys_commitdes!="*CHG*" OR pansys_commitdes!="*TASK*" with the intent of creating a report of changes that are not following change control processes. With these searches I get no matches. I also tried pansys_commitdes=* and pansys_commitdes="*" and also get no matches...but if I do pansys_commitdes=TASK0123456 it matches fine.

kgs_0-1614035797164.png

kgs_1-1614035802286.png

This is an example of a log I'm trying to match on:

 

Feb 22 09:08:52 paloalto.contoso.com 1,2021/02/22 09:08:52,01234567890,SYSTEM,general,0,2021/02/22 09:08:52,,general,,0,0,general,informational,"CommitAll job started processing. Dequeue time=2021/02/22 09:08:52. JobId=3938587.User: abc . Commit Description: TASK0123456",22356363,0x0,0,0,0,0,,pan-01

 

 

 

 

 

 

 

 

Labels (2)
0 Karma

to4kawa
Ultra Champion

try CASE("")

NOT ( CASE("TASK") OR CASE("CHG") )

 

sample:

index=_internal NOT (CASE("Metrics") OR CASE("splunkd") OR CASE("WARN") )

 

0 Karma

kgs
Loves-to-Learn

I'm sorry, I'm not sure exactly what you mean. Are you suggesting to use CASE and not use the extracted field or to use CASE with the extracted field? Either way, I'm not really sure the correct syntax to use...I should add, I'm very new to Splunk. I've used it for about 2 weeks 😕

I checked this page and its not very clear: https://docs.splunk.com/Documentation/Splunk/8.1.1/Search/UseCASEandTERMtomatchphrases

0 Karma
Get Updates on the Splunk Community!

AppDynamics Summer Webinars

This summer, our mighty AppDynamics team is cooking up some delicious content on YouTube Live to satiate your ...

SOCin’ it to you at Splunk University

Splunk University is expanding its instructor-led learning portfolio with dedicated Security tracks at .conf25 ...

Credit Card Data Protection & PCI Compliance with Splunk Edge Processor

Organizations handling credit card transactions know that PCI DSS compliance is both critical and complex. The ...