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
Get Updates on the Splunk Community!

Index This | When is October more than just the tenth month?

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

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What’s New & Next in Splunk SOAR

 Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us for an ...