Splunk Search

How to get success percentage by using timechart  by country?

lucky
Explorer

Hi All,

Good Day!

 

I have 2 indexes and having different source types  and diff uri,

index 1--- nere having httpstatuscodes 
 1.  one uri having only 200,403,422 are success remaining failure

2.remaing uri's 200 is success and remaining failure 

 

index 2--

diffrent-- uri --

one uri having 200 is success ---here having Respnsecodes  

 

how to get success percentage by using timechart  by country

please help on this 

Labels (1)
Tags (1)
0 Karma

lucky
Explorer

thanks..will try 

0 Karma

lucky
Explorer

Hi ,

 

I am having data like  below 

1.httpstatuscode 

2.responsecode 

3.CountryCode 

4.countrycode 

need to show success perc by country 

Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
index=index1 OR index=index2
| eval success=case(index=="index1" AND url=="special url" AND httpstatuscode IN ("200","403","422"), "success", index="index1" AND httpstatuscode == "200", "success", index=="index2" AND responsecode=="200", "success", 1==1, "failure")
| eval country=coalesce(CountryCode, countrycode)
| bin _time span=1d
| stats count by _time country success
| eventstats sum(count) as total by _time country
| eval percent=if(success="success", 100 * count / total, null())
| timechart values(percent) by country
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

index=index1 OR index=index2
| eval success=case(index=="index1" AND url=="special url" AND httpstatuscode IN ("200","403","422"), "success", index="index1" AND httpstatuscode == "200", "success", index=="index2" AND Responsecode=="200", "success", 1==1, "failure")
| bin _time span=1d
| stats count by _time country success
| eventstats sum(count) as total by _time country
| eval percent=if(success="success", 100 * count / total, null())
| timechart values(percent) by country
0 Karma
Get Updates on the Splunk Community!

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...

Stay Connected: Your Guide to October Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...