<?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: Timechart Function in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Function/m-p/73641#M18455</link>
    <description>&lt;P&gt;It's not quite as straight forward as you might think. The &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.2/SearchReference/Timechart"&gt;timechart&lt;/A&gt; command can only accept one 'split by" series, kind of like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timechart count by field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So you need to create a single field that reflects the type of data. There are lots of ways to do this, but I suggest this as a starting point:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Create an eventtype for each profile. For example, run the following search and then save it as an eventtype named "Mobile" ("Create Eventtype" in 4.3)&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;"OutputProfile-Mobile" NOT "Failed"&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;After you have created the eventtypes, run the following search&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;eventtype=Mobile OR eventtype=P720 OR eventtype=P1080 | timechart count(host) by eventtype&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;BTW, &lt;CODE&gt;count(host)&lt;/CODE&gt; actually means "count the number of events that have a value for the host field", and &lt;STRONG&gt;not&lt;/STRONG&gt; "count the number of unique hosts." I mention this because it is often a point of confusion.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jun 2012 17:23:30 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2012-06-13T17:23:30Z</dc:date>
    <item>
      <title>Timechart Function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Function/m-p/73640#M18454</link>
      <description>&lt;P&gt;I am new to Splunk, so this question might be straight forward! I am looking to create a stacked chart by day.&lt;/P&gt;

&lt;P&gt;This is the search that worked for 1 column, I am looking to add many more columns in addition to Mobile, i.e. 720P, 1080P. So the strings are OutputProfile-720P, OutputProfile-1080P. What is the best way to create Time chart with 3 columns and then create a stacked bar chart.&lt;/P&gt;

&lt;P&gt;"OutputProfile-Mobile" NOT "Failed" | timechart count(host) as "Mobile"&lt;/P&gt;

&lt;P&gt;Thanks very much for your help!&lt;BR /&gt;
Chintu&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2012 23:47:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Function/m-p/73640#M18454</guid>
      <dc:creator>chintu30</dc:creator>
      <dc:date>2012-06-12T23:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart Function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Function/m-p/73641#M18455</link>
      <description>&lt;P&gt;It's not quite as straight forward as you might think. The &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.2/SearchReference/Timechart"&gt;timechart&lt;/A&gt; command can only accept one 'split by" series, kind of like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timechart count by field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So you need to create a single field that reflects the type of data. There are lots of ways to do this, but I suggest this as a starting point:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Create an eventtype for each profile. For example, run the following search and then save it as an eventtype named "Mobile" ("Create Eventtype" in 4.3)&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;"OutputProfile-Mobile" NOT "Failed"&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;After you have created the eventtypes, run the following search&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;eventtype=Mobile OR eventtype=P720 OR eventtype=P1080 | timechart count(host) by eventtype&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;BTW, &lt;CODE&gt;count(host)&lt;/CODE&gt; actually means "count the number of events that have a value for the host field", and &lt;STRONG&gt;not&lt;/STRONG&gt; "count the number of unique hosts." I mention this because it is often a point of confusion.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2012 17:23:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Function/m-p/73641#M18455</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-06-13T17:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart Function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Function/m-p/73642#M18456</link>
      <description>&lt;P&gt;Try this,&lt;/P&gt;

&lt;P&gt;search "OutputProfile-720P" OR "OutputProfile-1080P" NOT "Failed" | rex "OutputProfile-(?&lt;MOBILE_TYPE&gt;\d+\w{1})"| timechart count by MOBILE_TYPE&lt;/MOBILE_TYPE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2012 17:46:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Function/m-p/73642#M18456</guid>
      <dc:creator>Bubeshkumar</dc:creator>
      <dc:date>2012-06-13T17:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart Function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Function/m-p/73643#M18457</link>
      <description>&lt;P&gt;MOBILE_TYPE at the end has to be lower-case, as field names are case-sensitive. You could make that search even more generic with&lt;/P&gt;

&lt;P&gt;"OutputProfile-720P" OR "OutputProfile-1080P" OR "OutputProfile-Mobile" NOT "Failed" | rex "OutputProfile-(?&lt;PROFILE_TYPE&gt;\S+)"| timechart count by profile_type&lt;/PROFILE_TYPE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2012 17:59:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Function/m-p/73643#M18457</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-06-13T17:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart Function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Function/m-p/73644#M18458</link>
      <description>&lt;P&gt;Yes its case sensitive, I dont know some how its not showing my backslash and uppercase were gone i dont know, hopefully this comment displays my search properly...:)&lt;/P&gt;

&lt;P&gt;search "OutputProfile-720P" OR "OutputProfile-1080P" NOT "Failed" | rex "OutputProfile-(?&lt;MOBILE_TYPE&gt;\d+\w{1})"| timechart count by mobile_type&lt;/MOBILE_TYPE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2012 18:03:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Function/m-p/73644#M18458</guid>
      <dc:creator>Bubeshkumar</dc:creator>
      <dc:date>2012-06-13T18:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart Function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Function/m-p/73645#M18459</link>
      <description>&lt;P&gt;Thanks very much, this was very helpful!&lt;/P&gt;

&lt;P&gt;I had just a couple more questions - &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;For the time range - what is the best way to show the data by month, and the current month's data will update maybe end of every day?&lt;/LI&gt;
&lt;LI&gt;In the above situation - will it run the search every time the dashboard is loaded? or will it store the data for historical data and just load the current data. &lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2012 21:20:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Function/m-p/73645#M18459</guid>
      <dc:creator>chintu30</dc:creator>
      <dc:date>2012-06-13T21:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart Function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Function/m-p/73646#M18460</link>
      <description>&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;Convert the current search to summary index search, schedule the search to run every day 1 am or 2 am to get yesterday's data and store it in summary index.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Create another search to get data from the summary index, and in your dashboard do the search with time chart span=1m for year. the search will be faster.&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;or&lt;BR /&gt;
Create a Advanced dashboard with time component so that with custom time you can make your search to run.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2012 22:11:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Function/m-p/73646#M18460</guid>
      <dc:creator>Bubeshkumar</dc:creator>
      <dc:date>2012-06-13T22:11:52Z</dc:date>
    </item>
  </channel>
</rss>

