<?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: 3 Report outputs into one in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/3-Report-outputs-into-one/m-p/500912#M140131</link>
    <description>&lt;P&gt;HI @n1ckl0ve,&lt;BR /&gt;
you have to create a single search tagging the results with the eval command, something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="*" sourcetype=iis AND NOT (".jpg" OR "*.txt") 
| eval time_taken_milliseconds=time_taken/1000
| eval metric=if(time_taken_milliseconds&amp;lt;2,"Below 2ms",time_taken_milliseconds&amp;gt;4,"More than 4 ms","Between 2-4 ms")
| timechart count by metric
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I quick hint: use always &lt;CODE&gt;index=your_index&lt;/CODE&gt; in your searches to have faster searches.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Tue, 19 May 2020 12:46:05 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2020-05-19T12:46:05Z</dc:date>
    <item>
      <title>3 Report outputs into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/3-Report-outputs-into-one/m-p/500911#M140130</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I'm fairly new to Splunk.  I'm trying to save some time with an automated report on IIS Time Taken.  I need to report on 3 metrics, % of time below 2ms, 4ms and any above 4ms and then output the searches to a single csv.&lt;/P&gt;

&lt;P&gt;I've probably gone about this the wrong way but so far I've created 3 separate Searches to 3 different reports.  What I'm trying to achieve is for the previous month's logs, Table the above 3 metrics by day, then add days together for a total, working out the % of each metric. &lt;/P&gt;

&lt;P&gt;So far this is what I've got which achieves my objective for the Metrics by Day and adds them together I'm not sure how to string them together and wonder if anyone could give me any pointers?&lt;/P&gt;

&lt;P&gt;host="&lt;EM&gt;" sourcetype=iis AND NOT ("&lt;/EM&gt;.jpg" OR "*.txt") | eval time_taken = time_taken/1000 | search time_taken&amp;lt; "2" | stats count by date | rename count as "Below 2ms"&lt;/P&gt;

&lt;P&gt;I've done one search for each of the metrics I'm trying to report on but assume I'm going about it the wrong way.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:28:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/3-Report-outputs-into-one/m-p/500911#M140130</guid>
      <dc:creator>n1ckl0ve</dc:creator>
      <dc:date>2020-09-30T05:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Report outputs into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/3-Report-outputs-into-one/m-p/500912#M140131</link>
      <description>&lt;P&gt;HI @n1ckl0ve,&lt;BR /&gt;
you have to create a single search tagging the results with the eval command, something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="*" sourcetype=iis AND NOT (".jpg" OR "*.txt") 
| eval time_taken_milliseconds=time_taken/1000
| eval metric=if(time_taken_milliseconds&amp;lt;2,"Below 2ms",time_taken_milliseconds&amp;gt;4,"More than 4 ms","Between 2-4 ms")
| timechart count by metric
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I quick hint: use always &lt;CODE&gt;index=your_index&lt;/CODE&gt; in your searches to have faster searches.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 12:46:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/3-Report-outputs-into-one/m-p/500912#M140131</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-05-19T12:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Report outputs into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/3-Report-outputs-into-one/m-p/500913#M140132</link>
      <description>&lt;P&gt;Hi @gcusello and thank you for your response.&lt;/P&gt;

&lt;P&gt;I've tried several ways to use your suggestion but I keep getting the arguments to the if function are invalid using it as is or by manipulating it in various ways.  I've tried to understand the if function by reading Splunk documentation. &lt;/P&gt;

&lt;P&gt;is it that the first argument filters the ones below 2ms, does the second argument use what ever wasn't caught by the first argument above 4ms and  what's left is the difference between the two?&lt;/P&gt;

&lt;P&gt;Thanks again Guiseppe.&lt;/P&gt;

&lt;P&gt;Nick&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 14:57:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/3-Report-outputs-into-one/m-p/500913#M140132</guid>
      <dc:creator>n1ckl0ve</dc:creator>
      <dc:date>2020-05-19T14:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Report outputs into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/3-Report-outputs-into-one/m-p/500914#M140133</link>
      <description>&lt;P&gt;Hi @gcusello and thank you for your response.&lt;/P&gt;

&lt;P&gt;I've tried several ways to use your suggestion but I keep getting the arguments to the if function are invalid using it as is or by manipulating it in various ways.  I've tried to understand the if function by reading Splunk documentation. &lt;/P&gt;

&lt;P&gt;is it that the first argument filters the ones below 2ms, does the second argument use what ever wasn't caught by the first argument above 4ms and  what's left is the difference between the two?&lt;/P&gt;

&lt;P&gt;Thanks again Giuseppe.&lt;/P&gt;

&lt;P&gt;Nick&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 15:00:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/3-Report-outputs-into-one/m-p/500914#M140133</guid>
      <dc:creator>n1ckl0ve</dc:creator>
      <dc:date>2020-05-19T15:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Report outputs into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/3-Report-outputs-into-one/m-p/500915#M140134</link>
      <description>&lt;P&gt;HI @n1ckl0ve,&lt;BR /&gt;
yes exactly.&lt;BR /&gt;
Sorry there's an horror of mine!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval metric=if(time_taken_milliseconds&amp;lt;2,"Below 2ms",if(time_taken_milliseconds&amp;gt;4,"More than 4 ms","Between 2-4 ms"))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You could also use "case" instead "if", but I find easier this way.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 15:12:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/3-Report-outputs-into-one/m-p/500915#M140134</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-05-19T15:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Report outputs into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/3-Report-outputs-into-one/m-p/500916#M140135</link>
      <description>&lt;P&gt;Hi Giuseppe,  &lt;/P&gt;

&lt;P&gt;That's great thank you for helping with that.  That basically works out of the box.  I've changed timechart count by metric for timechart span=1d count by metric and that's creating the report perfectly including total count and percentages.  &lt;/P&gt;

&lt;P&gt;I am very grateful for your time thank you again,&lt;BR /&gt;
Best regards&lt;/P&gt;

&lt;P&gt;Nick&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 15:29:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/3-Report-outputs-into-one/m-p/500916#M140135</guid>
      <dc:creator>n1ckl0ve</dc:creator>
      <dc:date>2020-05-19T15:29:25Z</dc:date>
    </item>
  </channel>
</rss>

