Splunk Search

Extracting a value from log message

sahana
Engager

Hi,

I have a requirement like i need to extract a some card value which was present inside the message body of the log. In this value would come to logs in two different names. Can you please how can i fetch these value and display it in  table.

 

thanks

Labels (1)
0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

Without examples from your data it's hard to show how this exactly can do. But in general level you can do it with eval and e.g. case/if/coalesce  like this.

| eval field = coalesce(f1, f2)
| eval field = if (index=="ix1", f1, f2)
| table field

Select one of those evals based on your data or change names etc.

r. Ismo 

0 Karma
Get Updates on the Splunk Community!

The All New Performance Insights for Splunk

Splunk gives you amazing tools to analyze system data and make business-critical decisions, react to issues, ...

Good Sourcetype Naming

When it comes to getting data in, one of the earliest decisions made is what to use as a sourcetype. Often, ...

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...