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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...