Splunk Search

how to compare same search for two different time range

aravindhan87
New Member

Hi,

I want to compare same uri_stems for different time frame . This is the query I am using but getting error as "Unknown Search command 'index'".

Query:

index="iis" host=server* earliest=$Series1.earliest$ latest=$Series1.latest$ | rex field=cs_uri_stem "[^.](?P<Extension>.)" | where (Extension="" OR Extension=".aspx" OR Extension=".axd" OR Extension=".asmx") | eval cs_uri_stem=lower(cs_uri_stem) | eval cs_host=Addition+cs_host | lookup PageMapping URL as cs_uri_stem, Method as cs_method,Application as cs_host output PageGroup as PageGroup,Critical as Critical TestedLoad as TestedLoad | where Critical=1 | stats avg(time_taken) as Pre_AverageResponseTime,perc90(time_taken) as Pre_90ResponseTime,perc75(time_taken) as Pre_75ResponseTime,count as Pre_TotalHits,max(TestedLoad) as Pre_TestedinLab by PageGroup,cs_host | eval Load%ToTestedInLabA=tostring(round(TotalHits*100/TestedinLab,2))+"%" | fields PageGroup,cs_host,Pre_AverageResponseTime,Pre_90ResponseTime,Pre_75ResponseTime,Pre_TotalHits | sort -cs_host | join type=outer cs_uri_stem [index="iis" host=server* earliest=$Series2.earliest$ latest=$Series2.latest$ | rex field=cs_uri_stem "[^.](?P<Extension>.)" | where (Extension="" OR Extension=".aspx" OR Extension=".axd" OR Extension=".asmx") | eval cs_uri_stem=lower(cs_uri_stem) | eval cs_host=Addition+cs_host | lookup PageMapping URL as cs_uri_stem, Method as cs_method,Application as cs_host output PageGroup as PageGroup,Critical as Critical TestedLoad as TestedLoad | where Critical=1 | stats avg(time_taken) as Pre_AverageResponseTime,perc90(time_taken) as Pre_90ResponseTime,perc75(time_taken) as Pre_75ResponseTime,count as Pre_TotalHits,max(TestedLoad) as Pre_TestedinLab by PageGroup,cs_host | eval Load%ToTestedInLabA=tostring(round(TotalHits*100/TestedinLab,2))+"%" | fields PageGroup,cs_host,Pre_AverageResponseTime,Pre_90ResponseTime,Pre_75ResponseTime,Pre_TotalHits | sort -cs_host]

Tags (2)
0 Karma
1 Solution

ramdaspr
Contributor

You subsearch needs to start with [search index="iis" ....

View solution in original post

ramdaspr
Contributor

You subsearch needs to start with [search index="iis" ....

Get Updates on the Splunk Community!

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...