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!

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 ...