Splunk Search

How to filter out rows for individual tables by Metric date?

minkyuk
Explorer

Hello,

I have a handful of tables that contain monthly reported data. Each table starts at a different Metric time, meaning table 1 starts the report 2015/1/1 while table 2 could be starting on 2015/3/1.

I am trying to filter out every first two rows from each table. I could manually go through every table and put

|where metric_date < ****** 

but I feel like there should be a way to automate this process.

Can anyone help if you have any idea?

Thank you ahead,
J

Tags (4)
0 Karma
1 Solution

jeffland
SplunkTrust
SplunkTrust

Doesn't the head function do exactly what you need? See docs here.

View solution in original post

jeffland
SplunkTrust
SplunkTrust

Doesn't the head function do exactly what you need? See docs here.

minkyuk
Explorer

Hi.. sorry for the late accept.
head is the function I was kind of looking for, but how could I exclude the first rows instead of returning them?

0 Karma

jeffland
SplunkTrust
SplunkTrust

AFAIK, there's no "official" way to do it.
I've only ever been able to do this with | streamstats count as c | where c>10 (hardly any performance impact).

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