<?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: Convert to Timechart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154880#M43563</link>
    <description>&lt;P&gt;FWIW - I think you should learn about how timechart works instead of asking the community to give you ready-made solutions.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Feb 2014 08:25:08 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2014-02-19T08:25:08Z</dc:date>
    <item>
      <title>Convert to Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154873#M43556</link>
      <description>&lt;P&gt;My search string is &lt;BR /&gt;
(host=A AND "ER"=XXW) OR (host=B AND "EMPCODE"=ABC AND ) | stats sum(field)total ,count("user") as Count|eval Average=total /Count|table field total ,Count,Average&lt;/P&gt;

&lt;P&gt;Actually I want to produce a timechart report and _time on X axis and Average on Y axis.&lt;BR /&gt;
Can anybody help me to convert the above search to timechart format.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 10:20:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154873#M43556</guid>
      <dc:creator>SplunkBaby</dc:creator>
      <dc:date>2014-02-18T10:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154874#M43557</link>
      <description>&lt;P&gt;You should change stats in eventstats, in this way you keep _time fild along the search. After that you can use timechart, you can also use math inline with it &lt;BR /&gt;
timechart span=1h eval(total/Count) as Average.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 11:24:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154874#M43557</guid>
      <dc:creator>emaccaferri</dc:creator>
      <dc:date>2014-02-18T11:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154875#M43558</link>
      <description>&lt;P&gt;I tried this and getting the error&lt;BR /&gt;
Error in 'timechart' command: The specifier 'eval' is invalid. It must be in form &lt;FUNC&gt;(&lt;FIELD&gt;). For example: max(size). &lt;/FIELD&gt;&lt;/FUNC&gt;&lt;/P&gt;

&lt;P&gt;(host=A AND "ER"=ABC ) OR (host=B AND "EMPCODE"=ABC AND ) | stats sum(field)total ,count("user") as Count |timechart span=1h eval(TotalVisit/Count) by "ER Code"&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 14:08:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154875#M43558</guid>
      <dc:creator>SplunkBaby</dc:creator>
      <dc:date>2014-02-18T14:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154876#M43559</link>
      <description>&lt;P&gt;try &lt;BR /&gt;
(host=A AND "ER"=XXW) OR (host=B AND "EMPCODE"=ABC AND ) | eventstats sum(field)total ,count("user") as Count|eval Average=total /Count| timechart span=1h Average&lt;/P&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;P&gt;(host=A AND "ER"=XXW) OR (host=B AND "EMPCODE"=ABC AND ) | timechart span=1h eval(sum(field)/count("user")) as Average&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 14:22:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154876#M43559</guid>
      <dc:creator>emaccaferri</dc:creator>
      <dc:date>2014-02-18T14:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154877#M43560</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(host=A AND "ER"=XXW) OR (host=B AND "EMPCODE"=ABC AND ) | bucket _time span=1d | stats sum(field) as total ,count(user) as Count by _time |eval Average=total/Count | timechart span=1d max(Average) as Average
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Change the span value as per your need in bucket and timechart command (currently showing for 1 day).(both should match)&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 14:32:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154877#M43560</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-02-18T14:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154878#M43561</link>
      <description>&lt;P&gt;Both of this solution's doesn't work&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 15:29:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154878#M43561</guid>
      <dc:creator>SplunkBaby</dc:creator>
      <dc:date>2014-02-18T15:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154879#M43562</link>
      <description>&lt;P&gt;when i run the below query &lt;BR /&gt;
....| stats sum(Visits) as TotalVisit,count("USER_NAME") as Count|eval Average=TotalVisit/Count|table field TotalVisit,Count,Average&lt;BR /&gt;
Output is 212 ,2, 106.&lt;BR /&gt;
I need to convert this query to timechart base.&lt;BR /&gt;
I convert the above query to your recommendation and i am not getting   4002 rows with _time but averge is not displayed.I use span=1m in both place.&lt;BR /&gt;
Correct me if i am wrong.&lt;BR /&gt;
basic purpose of my query is &lt;BR /&gt;
1)calculate average(based on total and count) value on different time stamps.I would like to get the _time form host=B.&lt;BR /&gt;
_time of 2 host are different.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2014 07:57:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154879#M43562</guid>
      <dc:creator>SplunkBaby</dc:creator>
      <dc:date>2014-02-19T07:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154880#M43563</link>
      <description>&lt;P&gt;FWIW - I think you should learn about how timechart works instead of asking the community to give you ready-made solutions.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2014 08:25:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-to-Timechart/m-p/154880#M43563</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2014-02-19T08:25:08Z</dc:date>
    </item>
  </channel>
</rss>

