Splunk Search

How to compare two query result fields of the same query parameter

maruthi_s
New Member

Hi

Example

Line 1 : Fox is Jumping out of burrow in 10 seconds
Line 2 : Fox is Jumping out of hole in 20 seconds

Query is "Fox" , I need to compare which time is faster , whether its burrow or hole.

How do i compare burrow and hole for fox /any animal .

Thanks
Maruthi

Tags (1)
0 Karma
1 Solution

woodcock
Esteemed Legend

Like this:

... | rex "(?<subject>\w+).*\s+of\s+(?<source>\w+)\s+in\s+(?<delay>\d+)" | stats min(delay) AS delay by subject source | sort 0 delay | stats first(delay) AS delay first(source) AS source by subject

View solution in original post

0 Karma

woodcock
Esteemed Legend

Like this:

... | rex "(?<subject>\w+).*\s+of\s+(?<source>\w+)\s+in\s+(?<delay>\d+)" | stats min(delay) AS delay by subject source | sort 0 delay | stats first(delay) AS delay first(source) AS source by subject
0 Karma

maruthi_s
New Member

Thanks @woodcock. This solution helps

0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...