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!

Enterprise Security Content Updates (ESCU) - New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 3 releases of new content via the Enterprise ...

Thought Leaders are Validating Your Hard Work and Training Rigor

As a Splunk enthusiast and member of the Splunk Community, you are one of thousands who recognize the value of ...

.conf23 Registration is Now Open!

Time to toss the .conf-etti &#x1f389; —  .conf23 registration is open!   Join us in Las Vegas July 17-20 for ...