Hi @woodcock
In the end i can't get the | tstats first stuff | tstats append=t second stuff | stats values (*) AS * BY NPID to work. I think because i have to use GROUP by MXTIMING.Context+Command as i need to see unique lines of each of them.
I did get the Group by working, but i hit such a strange bug.
After the GROUP by i had to remove all my evals:
|eval time_slice_per_min = (stop-start)/60 | eval Throughput_per_minute= count/time_slice_per_min | eval average = round(average, 1) | eval average=tostring(average, "commas") | eval stdev = round(stdev, 1) | sort - average |
as it was removing lines before the stats could get to them!!! - I have no idea why.
working code
<query>| tstats summariesonly=$summariesonly_token$ avg(MXTIMING.Elapsed) AS average, count(MXTIMING.Elapsed) AS count, stdev(MXTIMING.Elapsed) AS stdev, median(MXTIMING.Elapsed) AS median, exactperc95(MXTIMING.Elapsed) AS perc95, exactperc99.5(MXTIMING.Elapsed) AS perc99.5, min(MXTIMING.Elapsed) AS min, max(MXTIMING.Elapsed) AS max,earliest(_time) as start, latest(_time) as stop FROM datamodel=MXTIMING_TEST WHERE
host=$host_token$
AND MXTIMING.source_path = *$source_path_search_token$
AND MXTIMING.UserName2=$MXTIMING_UserName_token$
AND MXTIMING.NPID=*$MXTIMING_NPID_token$*
AND MXTIMING.TYPE8=$MXTIMING_TYPE_TOKEN$
AND MXTIMING.Context+Command = *$MXTIMING_Context_token$#*
AND MXTIMING.Context+Command = *#$MXTIMING_Command_token$*
AND MXTIMING.Time = *
GROUPBY MXTIMING.Context+Command MXTIMING.NPID MXTIMING.Time | rename MXTIMING.Context+Command as Context+Command |rename MXTIMING.NPID as NPID
| join NPID [| tstats summariesonly=$summariesonly_token$ count(SERVICE.NPID) AS count2 FROM datamodel=SERVICE WHERE ( host=$host_token$)
AND SERVICE.NICKNAME = $NICKNAME_TOKEN$
GROUPBY SERVICE.NICKNAME SERVICE.NPID | rename SERVICE.NPID AS NPID ]
| stats avg(average) as average count(count) as count stdev(average) as stdev median(median) as median exactperc95(perc95) AS perc95, exactperc99.5(perc99.5) AS perc99.5, min(min) AS min, max(max) AS max,earliest(_time) as start, latest(_time) as stop by Context+Command |</query>
Not working code
<query>| tstats summariesonly=$summariesonly_token$ avg(MXTIMING.Elapsed) AS average, count(MXTIMING.Elapsed) AS count, stdev(MXTIMING.Elapsed) AS stdev, median(MXTIMING.Elapsed) AS median, exactperc95(MXTIMING.Elapsed) AS perc95, exactperc99.5(MXTIMING.Elapsed) AS perc99.5, min(MXTIMING.Elapsed) AS min, max(MXTIMING.Elapsed) AS max,earliest(_time) as start, latest(_time) as stop FROM datamodel=MXTIMING_TEST WHERE
host=$host_token$
AND MXTIMING.source_path = *$source_path_search_token$
AND MXTIMING.UserName2=$MXTIMING_UserName_token$
AND MXTIMING.NPID=*$MXTIMING_NPID_token$*
AND MXTIMING.TYPE8=$MXTIMING_TYPE_TOKEN$
AND MXTIMING.Context+Command = *$MXTIMING_Context_token$#*
AND MXTIMING.Context+Command = *#$MXTIMING_Command_token$*
AND MXTIMING.Time = *
GROUPBY MXTIMING.Context+Command MXTIMING.NPID MXTIMING.Time | rename MXTIMING.Context+Command as Context+Command |rename MXTIMING.NPID as NPID
| join NPID [| tstats summariesonly=$summariesonly_token$ count(SERVICE.NPID) AS count2 FROM datamodel=SERVICE WHERE ( host=$host_token$)
AND SERVICE.NICKNAME = $NICKNAME_TOKEN$
GROUPBY SERVICE.NICKNAME SERVICE.NPID | rename SERVICE.NPID AS NPID ]
|eval time_slice_per_min = (stop-start)/60 | eval Throughput_per_minute= count/time_slice_per_min | eval average = round(average, 1) | eval average=tostring(average, "commas") | eval stdev = round(stdev, 1) | sort - average | stats avg(average) as average count(count) as count stdev(average) as stdev median(median) as median exactperc95(perc95) AS perc95, exactperc99.5(perc99.5) AS perc99.5, min(min) AS min, max(max) AS max,earliest(_time) as start, latest(_time) as stop by Context+Command </query>
... View more