Splunk Search

How to achieve list of manid breaching Authorization SLA?

Sekhar
Explorer

We have two events query

Start event

Index=x source type= xx "String" extacted fields s like manid,actionid,batch I'd

End event 

Index=y source type=y " string recived" extacted fields like manid ,actionid

 

Calculate different between start and end events group by manid and count number of mandid exceeding different above 30 sec .  | Table _time manid duration

index=x source type= xx "String") OR (index=y source type=y " string recived") | stats values(_time) as time values(actionid) as actionid values(batchid) as batchid by manid | eval duration = max(time) - min(time)|eval excessive = if(duration > 30, duration, null()) | stats count(excessive) as excess_count avg(excessive) as excess_avg by manid

But unable get _time vaules 

 

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You still have the same question as I asked you the last time you posted about this - which time do you want? The min time or max time?

(index=x source type= xx "String") OR (index=y source type=y " string recived") | stats values(_time) as time values(actionid) as actionid values(batchid) as batchid by manid | eval duration = max(time) - min(time)|eval excessive = if(duration > 30, duration, null()) | stats count(excessive) as excess_count avg(excessive) as excess_avg max(time) as _time by manid

 

0 Karma

yeahnah
Motivator

Hi @Sekhar 

Using values will result in a multivalue output (possibly more than 1 value) field, so you need to use multivalue eval commands to process that output.

Anyway, in this the best place to find the start (min) and end (max) times is by using the stats command and then eval the difference.  Something like this should meet your needs...

index=x source type= xx "String") OR (index=y source type=y " string recived") 
| stats
    min(_time) as start_time
    max(_time) as end_time
    values(actionid) as actionid
    values(batchid) as batchid
  by manid 
| eval duration = (end_time - start_time) 
| eval excessive = if(duration > 30, duration, null()) 
| stats count(excessive) as excess_count avg(excessive) as excess_avg by manid

Hope that helps

 

0 Karma

Sekhar
Explorer

Above  query i add table but not displayed any thing 

| Table start_time duration  mandid

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...