<?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: Getting a timechart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220958#M188128</link>
    <description>&lt;P&gt;dont really understand what you are asking for but how about this?&lt;BR /&gt;
&lt;CODE&gt;index=prod host=hostname* source="/home/logs/log" | rex field=_raw "TIME\s:\s(?[^\s]*)\s(?\d+)\smsec" | search ms&amp;gt;0 action="REMOVE" | timechart avg(ms) AS avg_duration_ms by host&lt;/CODE&gt; &lt;/P&gt;</description>
    <pubDate>Fri, 22 Apr 2016 20:22:55 GMT</pubDate>
    <dc:creator>cramasta</dc:creator>
    <dc:date>2016-04-22T20:22:55Z</dc:date>
    <item>
      <title>Getting a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220957#M188127</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have following query, from which I am able to produce a table&lt;/P&gt;

&lt;P&gt;However, the above query doesn't get results by hostname. &lt;BR /&gt;
index=prod host=hostname* source="/home/logs/&lt;EM&gt;log&lt;/EM&gt;" | rex field=_raw "TIME\s:\s(?[^\s]*)\s(?\d+)\smsec" | search ms&amp;gt;0 | table _time,action,ms | rename ms as "duration[ms]" | sort -_time &lt;/P&gt;

&lt;P&gt;Summary:&lt;BR /&gt;
 are DELETE, ADD, MODIFY,SEARCH &lt;/P&gt;

&lt;P&gt;What we have is 3 host, hostname01, 02 and 03.  I am looking to generate a 'timechart' where I would obtain a  taken on a host and the time  it took to complete.&lt;/P&gt;

&lt;P&gt;Any suggestion?&lt;/P&gt;

&lt;P&gt;one tested but not getting the result&lt;/P&gt;

&lt;P&gt;index=prod host=hostname* source="/home/logs/&lt;EM&gt;log&lt;/EM&gt;" | rex field=_raw "TIME\s:\s(?[^\s]*)\s(?\d+)\smsec" | search ms&amp;gt;0 action="REMOVE" | timechart avg(ms) avg(action) | rename ms as "duration[ms]" | sort -_time &lt;/P&gt;

&lt;P&gt;Thank you in advance for assistance. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:32:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220957#M188127</guid>
      <dc:creator>smomin</dc:creator>
      <dc:date>2020-09-29T09:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220958#M188128</link>
      <description>&lt;P&gt;dont really understand what you are asking for but how about this?&lt;BR /&gt;
&lt;CODE&gt;index=prod host=hostname* source="/home/logs/log" | rex field=_raw "TIME\s:\s(?[^\s]*)\s(?\d+)\smsec" | search ms&amp;gt;0 action="REMOVE" | timechart avg(ms) AS avg_duration_ms by host&lt;/CODE&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2016 20:22:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220958#M188128</guid>
      <dc:creator>cramasta</dc:creator>
      <dc:date>2016-04-22T20:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220959#M188129</link>
      <description>&lt;P&gt;Hello cramasta,&lt;/P&gt;

&lt;P&gt;Thankyou for your response.&lt;/P&gt;

&lt;P&gt;Since my query here I have developed this:&lt;/P&gt;

&lt;P&gt;index=prod host=hostname* source="/logs/log*" | rex field=_raw "TIME\s:\s(?[^\s]*)\s(?\d+)\smsec" | search ms&amp;gt;30 action=REMOVE OR MODIFY OR DELETE OR ADD OR SEARCH | chart avg(ms) by action host limit=100&lt;/P&gt;

&lt;P&gt;However, with above I am getting the list by host, but it is giving me AVERAGE as avg(ms). I want to be able to ALL the ms time for all actions. &lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Sayena&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:32:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220959#M188129</guid>
      <dc:creator>smomin</dc:creator>
      <dc:date>2020-09-29T09:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220960#M188130</link>
      <description>&lt;P&gt;Try something like this&lt;BR /&gt;
avg(ms) for all actions&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=prod host=hostname* source="/logs/log*" | rex field=_raw "TIME\s:\s(?[^\s]*)\s(?\d+)\smsec" | search ms&amp;gt;30 | timechart avg(ms) by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR avg(ms for a single action&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=prod host=hostname* source="/logs/log*" | rex field=_raw "TIME\s:\s(?[^\s]*)\s(?\d+)\smsec" | search ms&amp;gt;30 ACTION="ProvideActionNameHere" | timechart avg(ms) by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Apr 2016 20:50:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220960#M188130</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-04-22T20:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220961#M188131</link>
      <description>&lt;P&gt;I'm guessing the site is removing the field names from  the Rex commands?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2016 21:04:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220961#M188131</guid>
      <dc:creator>cramasta</dc:creator>
      <dc:date>2016-04-22T21:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220962#M188132</link>
      <description>&lt;P&gt;Still not very clear what you want the final output to be but see if this is any closer&lt;BR /&gt;
&lt;CODE&gt;index=prod host=hostname* source="/home/logs/log" | rex field=_raw "TIME\s:\s(?[^\s]*)\s(?\d+)\smsec" | search ms&amp;gt;0 action="REMOVE" | eval host_action=host."_".action| timechart avg(ms) AS avg_duration_ms by host_action&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Please replaced the Rex command with your original as I think the site is removing the field name assignments.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2016 21:05:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220962#M188132</guid>
      <dc:creator>cramasta</dc:creator>
      <dc:date>2016-04-22T21:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220963#M188133</link>
      <description>&lt;P&gt;Hello Somesoni2,&lt;/P&gt;

&lt;P&gt;Per my understanding avg(ms) would give 'average ms (time). instead of 'avg', how can I get the chart to list ALL the 'actions' occurring in MS by host. &lt;/P&gt;

&lt;P&gt;index=prod host=hostname* source="/logs/log*"| rex field=_raw "TIME\s:\s(?[^\s]*)\s(?\d+)\smsec" | search ms&amp;gt;0 action=REMOVE OR MODIFY OR DELETE OR ADD OR SEARCH |chart avg(ms) by action host&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Sayena&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:32:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220963#M188133</guid>
      <dc:creator>smomin</dc:creator>
      <dc:date>2020-09-29T09:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220964#M188134</link>
      <description>&lt;P&gt;Thank you. This is getting closer. However, timechart avg(ms) AS avg_duration_ms by host_action&lt;/P&gt;

&lt;P&gt;Instead of getting avg(ms), how can I get it to return top highest ms in the time window. I tried top limit =10&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:32:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220964#M188134</guid>
      <dc:creator>smomin</dc:creator>
      <dc:date>2020-09-29T09:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220965#M188135</link>
      <description>&lt;P&gt;This will give you the max ms for each host/action/time window&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=prod host=hostname* source="/home/logs/log" | rex field=_raw "TIME\s:\s(?[^\s]*)\s(?\d+)\smsec" | search ms&amp;gt;0 action="REMOVE" | eval host_action=host."_".action| timechart max(ms) AS max_duration_ms by host_action limit=30&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2016 22:07:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220965#M188135</guid>
      <dc:creator>cramasta</dc:creator>
      <dc:date>2016-04-22T22:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220966#M188136</link>
      <description>&lt;P&gt;Awesome. This worked.&lt;/P&gt;

&lt;P&gt;Questions, when we are doing max(ms) in combination with limit=30, shouldn't it return 30 entries with MAXIMUM MS time?&lt;/P&gt;

&lt;P&gt;If above statement is correct, then I am not getting top 30 entries. &lt;/P&gt;

&lt;P&gt;In the 'event' output I am seeing 425 events occur, but its showing 46 entries under statistics. &lt;/P&gt;

&lt;P&gt;Is there configuration issue on splunk end?&lt;/P&gt;

&lt;P&gt;Hope you to hear from you soon. &lt;/P&gt;

&lt;P&gt;Thank you so much for all your time. &lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2016 22:56:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220966#M188136</guid>
      <dc:creator>smomin</dc:creator>
      <dc:date>2016-04-22T22:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220967#M188137</link>
      <description>&lt;P&gt;By defualt timechart only creates 10 unique series of your split by clause (everything else gets grouped into OTHER category. In this case the split by clause would be the host_action field. That means if you have 5 hosts with 3 possible actions you would have 15 total series to chart.  Setting limit=30 tells time chart to create UP TO  30 unique series if they exist. Its just a upper limit to adhear to.&lt;/P&gt;

&lt;P&gt;The output means that 425 events were found but timechart processed them down into to 46 results (or rows). Each row is a is a unique time span&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2016 23:20:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220967#M188137</guid>
      <dc:creator>cramasta</dc:creator>
      <dc:date>2016-04-22T23:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220968#M188138</link>
      <description>&lt;P&gt;If this helped you please mark this Answered. Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 13:35:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-timechart/m-p/220968#M188138</guid>
      <dc:creator>cramasta</dc:creator>
      <dc:date>2016-04-25T13:35:27Z</dc:date>
    </item>
  </channel>
</rss>

