Splunk Search

Selective display of values where column names are field values

kenbaugher
Path Finder

After looking at some examples online, I was able to come up with the below query, which can display one or more columns of data based on the selection of "sysname".

What we would like to do with this is optionally just two sysnames, and only the rows where the values do not match.

index=idx1 source="file1.log" sysname IN ("SYS1","SYS6")| table sysname value_name value_info | eval {sysname}=value_info | fields - sysname, value_info | stats values(*) as * by value_name

 

The data format is the below and there are a couple hundred value_names for each sysname with varying formats from integer values, to long strings

sysname, value_name, value_info

 

The above query displays the data something like this

value_name            SYS1                     SYS6
name1                       X                             Y
name2                       A                             A
name3                       B                             C

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
index=idx1 source="file1.log" sysname IN ("SYS1","SYS6")
| table sysname value_name value_info
| eventstats dc(value_info) as distinct_values by value_name
| where distinct_values > 1
| xyseries value_name sysname value_info
0 Karma

kenbaugher
Path Finder

perfect, thank you

0 Karma
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL  The Splunk AI Assistant for SPL ...

Buttercup Games: Further Dashboarding Techniques (Part 5)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Customers Increasingly Choose Splunk for Observability

For the second year in a row, Splunk was recognized as a Leader in the 2024 Gartner® Magic Quadrant™ for ...