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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...