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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...