<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: After using a JOIN i now have multiple lines, however this has affected my maths as before i have sumed up maths, now i have maths per line in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/After-using-a-JOIN-i-now-have-multiple-lines-however-this-has/m-p/305108#M91633</link>
    <description>&lt;P&gt;Hi @woodcock &lt;/P&gt;

&lt;P&gt;In the end i can't get the &lt;CODE&gt;| tstats first stuff | tstats append=t second stuff | stats values (*) AS * BY NPID&lt;/CODE&gt; 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.&lt;/P&gt;

&lt;P&gt;I did get the Group by working, but i hit such a strange bug.&lt;/P&gt;

&lt;P&gt;After the GROUP by i had to remove all my evals:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|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 |
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;as it was removing lines before the stats could get to them!!! - I have no idea why.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;working code&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;query&amp;gt;| 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 |&amp;lt;/query&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Not working code&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;query&amp;gt;| 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 &amp;lt;/query&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 14 Jul 2017 14:48:54 GMT</pubDate>
    <dc:creator>robertlynch2020</dc:creator>
    <dc:date>2017-07-14T14:48:54Z</dc:date>
    <item>
      <title>After using a JOIN i now have multiple lines, however this has affected my maths as before i have sumed up maths, now i have maths per line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-using-a-JOIN-i-now-have-multiple-lines-however-this-has/m-p/305105#M91630</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I use a JOIN and now i have multiple lines and not unique ones.&lt;BR /&gt;
It returned one line per unique Context+Command.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Before&lt;/STRONG&gt;&lt;BR /&gt;
GROUPBY Context+Command&lt;BR /&gt;
One line - This was working fine &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3192i00CC985A810713B3/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;After&lt;/STRONG&gt;&lt;BR /&gt;
GROUPBY Context+Command NPID&lt;BR /&gt;
Now multiple lines&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3193i0F2109C683B62F98/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;ORGINAL&lt;/STRONG&gt; - One line&lt;BR /&gt;
However i have to GROUPBY Context+Command NPID now and i am getting back multiple lines of maths. Before i work out how to re-run the maths on the outputted data, i want to know if i can do this with the JOIN?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true 
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 
WHERE host=RABO_SYSTEM_TEST 
AND MXTIMING.source_path = */net/dell430srv/dell430srv/apps/QCST_RABO_v3.1.8_SEC2/logs/traces/ 
AND MXTIMING.UserName2=* 
AND MXTIMING.NPID=*** 
AND GROUPBY MXTIMING.Context+Command 
AND Context+Command = *BTN_Yes#* 
AND Context+Command = *#**

| rename MXTIMING.Context+Command as Context+Command  |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 | fields - stop - start | 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;NEW&lt;/STRONG&gt; - Multiple lines&lt;BR /&gt;
NOW I need to do a JOIN from another TABLE on NPID, however i am getting multiple lines out now. I want to get the original .&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true 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=RABO_SYSTEM_TEST_MXTIMING 
AND MXTIMING.source_path = ** 
AND MXTIMING.UserName2=* 
AND MXTIMING.NPID=***  
AND MXTIMING.TYPE8=STANDARD 
AND MXTIMING.Context+Command = *BTN_Yes#*
AND MXTIMING.Context+Command = *#**
GROUPBY MXTIMING.Context+Command MXTIMING.NPID | rename MXTIMING.Context+Command as Context+Command  |rename MXTIMING.NPID as NPID 

| join NPID [| tstats summariesonly=true count(SERVICE.NPID) AS count2 FROM datamodel=SERVICE WHERE ( host=RABO_SYSTEM_TEST_MXTIMING) 
 AND SERVICE.NICKNAME = mx 
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
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now i understand why i get Multiple, lines (GROUPBY MXTIMING.Context+Command MXTIMING.NPID), but before i have to write code to re-calculate is there a way of doing it with ONE JOIN.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2017 14:21:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-using-a-JOIN-i-now-have-multiple-lines-however-this-has/m-p/305105#M91630</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2017-07-12T14:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: After using a JOIN i now have multiple lines, however this has affected my maths as before i have sumed up maths, now i have maths per line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-using-a-JOIN-i-now-have-multiple-lines-however-this-has/m-p/305106#M91631</link>
      <description>&lt;P&gt;Do not use &lt;CODE&gt;join&lt;/CODE&gt;, use &lt;CODE&gt;| tstats first stuff | tstats append=t second stuff | stats values (*) AS * BY NPID&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 01:50:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-using-a-JOIN-i-now-have-multiple-lines-however-this-has/m-p/305106#M91631</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-13T01:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: After using a JOIN i now have multiple lines, however this has affected my maths as before i have sumed up maths, now i have maths per line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-using-a-JOIN-i-now-have-multiple-lines-however-this-has/m-p/305107#M91632</link>
      <description>&lt;P&gt;In fact this does not seem to work (I thought it did at the start, sorry)&lt;BR /&gt;
One small comment, needed to add - |  tstats prestats=true append=t to get it to run&lt;/P&gt;

&lt;P&gt;The final command looks like below  however i have a token for SERVICE.NICKNAME  when i change it nothing updates, so the second tstats is not having any effect.&lt;/P&gt;

&lt;P&gt;The overall issues is i have 2 tables that i am trying to run maths off. They have a NPID in common.&lt;/P&gt;

&lt;P&gt;I am looking for a way to include/exclude the data both ways, so a user enters NICKNAME "MX" NPID 1 and 2 are selected in SERVICE-DATAMODEL, then maths is driven off MXTIMING-DATAMODEL table on NPID's 1 and 2.&lt;/P&gt;

&lt;P&gt;Also there is the reverse, where a user can pick TYPE "STANDARD" and NPID's 1 and 3 are used&lt;/P&gt;

&lt;P&gt;SERVICE-DATAMODEL&lt;BR /&gt;&lt;BR /&gt;
NPID    NICKNAME&lt;BR /&gt;&lt;BR /&gt;
1   MX&lt;BR /&gt;&lt;BR /&gt;
2   MX&lt;BR /&gt;&lt;BR /&gt;
3   ENGINE  &lt;/P&gt;

&lt;P&gt;MXTIMING-DATAMODEL&lt;BR /&gt;&lt;BR /&gt;
NPID    TYPE    Elapsed&lt;BR /&gt;
1   STANDARD    2&lt;BR /&gt;
1   STANDARD    1&lt;BR /&gt;
1   WAREHOUSE   3&lt;BR /&gt;
1   REAL_TIME   1&lt;BR /&gt;
2   AAA 3&lt;BR /&gt;
2   AAA 4&lt;BR /&gt;
2   AAA 1&lt;BR /&gt;
2   WAREHOUSE   1&lt;BR /&gt;
3   REAL_TIME   4&lt;BR /&gt;
3   STANDARD    1&lt;/P&gt;

&lt;P&gt;This i how i tried to applay your solution, but the second tstats is having no affect, perhaps i am missing something.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true 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=RABO_SYSTEM_TEST_MXTIMING2 
AND MXTIMING.source_path = ** 
AND MXTIMING.UserName2=* 
AND MXTIMING.NPID=***  
AND MXTIMING.TYPE8=STANDARD 
AND MXTIMING.Context+Command = **#*
AND MXTIMING.Context+Command = *#**
AND MXTIMING.Time = *
GROUPBY MXTIMING.Context+Command MXTIMING.NPID MXTIMING.Time | rename MXTIMING.Context+Command as Context+Command  |rename MXTIMING.NPID as NPID 

|  tstats prestats=true append=t summariesonly=true count(SERVICE.NPID) AS count2 FROM datamodel=SERVICE WHERE ( host=RABO_SYSTEM_TEST_MXTIMING2) 
 AND SERVICE.NICKNAME = mx 
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
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:52:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-using-a-JOIN-i-now-have-multiple-lines-however-this-has/m-p/305107#M91632</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2020-09-29T14:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: After using a JOIN i now have multiple lines, however this has affected my maths as before i have sumed up maths, now i have maths per line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-using-a-JOIN-i-now-have-multiple-lines-however-this-has/m-p/305108#M91633</link>
      <description>&lt;P&gt;Hi @woodcock &lt;/P&gt;

&lt;P&gt;In the end i can't get the &lt;CODE&gt;| tstats first stuff | tstats append=t second stuff | stats values (*) AS * BY NPID&lt;/CODE&gt; 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.&lt;/P&gt;

&lt;P&gt;I did get the Group by working, but i hit such a strange bug.&lt;/P&gt;

&lt;P&gt;After the GROUP by i had to remove all my evals:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|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 |
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;as it was removing lines before the stats could get to them!!! - I have no idea why.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;working code&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;query&amp;gt;| 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 |&amp;lt;/query&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Not working code&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;query&amp;gt;| 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 &amp;lt;/query&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Jul 2017 14:48:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-using-a-JOIN-i-now-have-multiple-lines-however-this-has/m-p/305108#M91633</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2017-07-14T14:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: After using a JOIN i now have multiple lines, however this has affected my maths as before i have sumed up maths, now i have maths per line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-using-a-JOIN-i-now-have-multiple-lines-however-this-has/m-p/305109#M91634</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| 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 

| tstats append=t 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 values(*) AS * BY 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 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 10 Sep 2017 20:01:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-using-a-JOIN-i-now-have-multiple-lines-however-this-has/m-p/305109#M91634</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-09-10T20:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: After using a JOIN i now have multiple lines, however this has affected my maths as before i have sumed up maths, now i have maths per line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-using-a-JOIN-i-now-have-multiple-lines-however-this-has/m-p/305110#M91635</link>
      <description>&lt;P&gt;Yes, the mistake i was making was running evals before i had pulled all me data back. The final query was this one.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true 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=TALANX_PostGoLive 
AND MXTIMING.Elapsed &amp;gt;  5 
           AND MXTIMING.source_path = ** 
AND MXTIMING.UserName2=* 
AND MXTIMING.NPID=***  
AND MXTIMING.MXTIMING_TYPE_DM=STANDARD 
AND MXTIMING.Context+Command = **#*
AND MXTIMING.Context+Command = *#**
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=true count(SERVICE.NPID) AS count2 FROM datamodel=SERVICE WHERE ( host=TALANX_PostGoLive) 
 AND SERVICE.NICKNAME = mx 
GROUPBY SERVICE.NICKNAME SERVICE.NPID  | rename SERVICE.NPID AS NPID ]  | join Context+Command  type=left [inputlookup TEST_MXTIMING.csv | rename Context_Command AS Context+Command  ] |  search | where average &amp;gt; Threshold OR isnull('Threshold') | fillnull Tags | eval Tags=if(Tags=0,"NO_TAG",Tags) | search Tags = *
 | 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 Tags | sort - average
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2017 09:04:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-using-a-JOIN-i-now-have-multiple-lines-however-this-has/m-p/305110#M91635</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2017-10-06T09:04:21Z</dc:date>
    </item>
  </channel>
</rss>

