Splunk Search

Table view

venkat0896
Path Finder

Hi Guys in splunk i need to create a report . i am trying to create a table with two columns please find the search key below

messageTypeKey=CM0001 ,disQualificationMessage=Cancelled by validation rules. SafeTimeNoPhoneHasNoEmail
Table messageTypeKey,disQualificationMessage

i need the message key and disqualification message
but the table looks like
CM0001 Cancelled

the message after the Cancelled is not appending
i need some suggestions on this
thanks in advance

Tags (1)
0 Karma

niketn
Legend

@venkat0896 you can use regular expression to perform field extraction as per your needs. Try the following rex command:

|  rex "disQualificationMessage=(?<disQualificationMessage>[^\.]+)\.\sSafeTimeNoPhoneHasNoEmail"

Following is a run anywhere example based on your sample data:

|  makeresults
|  eval _raw="messageTypeKey=CM0001 ,disQualificationMessage=Cancelled by validation rules. SafeTimeNoPhoneHasNoEmail" 
|  rex "disQualificationMessage=(?<disQualificationMessage>[^\.]+)\.\sSafeTimeNoPhoneHasNoEmail"
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

DavidHourani
Super Champion

Hi @venkat0896,

This makes total sense because you are allowing splunk to auto-extract the field.

By default the extraction that happens is KV which means key-value and in the case of disQualificationMessage=Cancelled by validation rulesthe value is only Cancelled and not the entire message.

What you will need to do is extract a new field matching exactly what you want to have in the disqualification message. If in your case you need "Cancelled by validation rules. " then you can use the following regex for the extraction :

disQualificationMessage\=(?<disQualificationMessage>[^\.]+)

You can use this run anywhere search to test it out:

| makeresults 
| eval A="messageTypeKey=CM0001 ,disQualificationMessage=Cancelled by validation rules. SafeTimeNoPhoneHasNoEmail" 
| rex field=A "disQualificationMessage\=(?<disQualificationMessage>[^\.]+)"

Try this for the search in your comment:

source=" " status="Cancelled" | rex field=_raw "disQualificationMessage\=(?<disQualificationMessage>[^\.]+)"| table messageTypeKey,disQualificationMessage

Cheers,
David

0 Karma

vnravikumar
Champion

Hi

Can you provide your query with sample events?

0 Karma

venkat0896
Path Finder

source=" " status="Cancelled" | table messageTypeKey,disQualificationMessage

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...