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!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...