Splunk Search

Subselect latest value from lookup, releative to event

lassel
Communicator

I am trying to correlate a event with a kvstore lookup, but I don't have a common key besides the username. So I want the closest matching value from the kvstore.

In SQL it looks like this:
http://sqlfiddle.com/#!9/0d563/1/0

In splunk the 'events' table would be my index and and the 'hello' would be my kvstore collection.

How can I make the equivalent query in Splunk?

0 Karma
1 Solution

lassel
Communicator

A learned the answer myself.

Splunk will search backwards by default, so by using the lookup command with a kvstore, you automatically get the closest matching event.

The equivalent splunk query to above would be:
index=events | lookup user by user OUTPUT message as message

View solution in original post

0 Karma

lassel
Communicator

A learned the answer myself.

Splunk will search backwards by default, so by using the lookup command with a kvstore, you automatically get the closest matching event.

The equivalent splunk query to above would be:
index=events | lookup user by user OUTPUT message as message

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...