Splunk Search

Finding the minimum and maximum value

jvmerilla
Path Finder

Hi All,

I have 3 files in one index, Cycle 10.csv, Cycle 11.csv, and Cycle 12.csv.

All of the 3 files have a "Cycle Number" fields with values:
10 for Cycle 10.csv

11 for Cycle 11.csv
12 for Cycle 12.csv

The Cycle Number field is just an indicator for each cycle to be able to identify the previous and the current cycle.

What I want to do is, first, to search the top 2 values of the Cycle Number field.
So, I am expecting that it would return only the Cycle 11.csv and Cycle 12.csv
Then, I would like to have a separate search for the Cycle Number with minimum value(Cycle 11.csv) and maximum values(Cycle 12.csv)

How would I be able to do this?

Thanks in advance and best regards. 🙂

Tags (3)
0 Karma

valiquet
Contributor

|inputlookups 10.csv | append [11.csv] | append [12.csv] | sort - | head 2

0 Karma
Get Updates on the Splunk Community!

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...