Splunk Search

How to Evaluate a field from the list of another search and create a table

manorajk
Engager

There are two queries

`query 1` will give ID, TIME fields

`query 2` will give list of SPECIAL_ID

I want to create a table with TIME, ID, IS_SPECIAL_ID

IS_SPECIAL_ID is evaluated to true/false based on the condition where is ID is part of the list SPECIAL_ID

 

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Simplistically, you could do something like this

`query 1`
| join type=outer ID
  [search `query 2`
   | dedup SPECIAL_ID
   | rename SPECIAL_ID as ID
   | eval IS_SPECIAL_ID="true"]
| fillnull value="false" IS_SPECIAL_ID

However, as has been mentioned in numerous posts, using join and subsearches is not  always best practice due to the limitations of subsearches, but if the above suffices, it is a simple approach.

View solution in original post

manorajk
Engager

@ITWhisperer Really appreciate your help here.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Simplistically, you could do something like this

`query 1`
| join type=outer ID
  [search `query 2`
   | dedup SPECIAL_ID
   | rename SPECIAL_ID as ID
   | eval IS_SPECIAL_ID="true"]
| fillnull value="false" IS_SPECIAL_ID

However, as has been mentioned in numerous posts, using join and subsearches is not  always best practice due to the limitations of subsearches, but if the above suffices, it is a simple approach.

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...