Splunk Search

How do I combine two unrelated inputlookups in the same search?

timmag
Explorer

Say I have one lookup which has various fields like host, source and other stuff. And another lookup which has fields like date, time and other stuff. I want to use these two lookups in the same search where-in I want to exclude the events that are there in second lookup from the first one. (No common fields for the lookups) How can I do that?

Tags (2)
0 Karma

MousumiChowdhur
Contributor

Hi!

You can use the below query to display the result from both the lookups:

| inputlookup <lookupname> | appendcols [ | inputlookup <lookupname>]

Please let me know what exactly do you need to exclude further.

0 Karma

timmag
Explorer

This isn't helping. From the first lookup, say I want to calculate the number of events generated for that day. The second lookup has time say 12:00-13:00 (1 hour) when I don't want the count of that events for that hour. So, I basically want the count of events for the day excluding the time mentioned in the second lookup.

0 Karma

MousumiChowdhur
Contributor

There needs to be a common field atleast time field to get the exclusion done.

0 Karma

somesoni2
Revered Legend

There has to some sort of relationship between those two lookup files based on which you can say an entry is in both lookups. What would be that rule if there are no common fields? Timestamp??

0 Karma

timmag
Explorer

I am not going to combine the lookups. I just want to use information from both of these in a single search.

0 Karma
Get Updates on the Splunk Community!

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 ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...