<?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: how to show current ERROR trend as a single value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-current-ERROR-trend-as-a-single-value/m-p/258929#M77612</link>
    <description>&lt;P&gt;If you need trend to be based on last an hour before the current one you need to add the following earliest and latest time to your base search (i.e. &lt;STRONG&gt;last 2 hours&lt;/STRONG&gt;) &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;earliest&amp;gt;-2h@h&amp;lt;/earliest&amp;gt;
  &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your search query will change as following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex ERROR co_name=$co_name$ env_name=$env_name$ | timechart span=1h count 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then edit &lt;STRONG&gt;Compared to&lt;/STRONG&gt; to 1 hour before so that current hour stats are compared with previous hour for trending.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;option name="trendInterval"&amp;gt;-1h&amp;lt;/option&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This way you will current hour count as Single value and last hour count as trend indicator. &lt;/P&gt;

&lt;P&gt;PS: Timeline will be restricted to only last two hour as per your need, but you can set -2h@h to even earlier value like -4h@h (last 4 hours) or even -0d@d (beginning of the day) to show hourly sparlike in the trend indicator. However, trend interval will remain 1 hour and current hour will always be compared with previous hour as set in above code block.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Dec 2016 03:50:18 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2016-12-01T03:50:18Z</dc:date>
    <item>
      <title>how to show current ERROR trend as a single value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-current-ERROR-trend-as-a-single-value/m-p/258925#M77608</link>
      <description>&lt;P&gt;HI,&lt;BR /&gt;
i am trying to display ERROR count as a single value and using below search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex ERROR co_name=$co_name$ env_name=$env_name$ | timechart span=1m count | eval _time=_time-now()%3600 | sort +_time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Nov 2016 23:02:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-show-current-ERROR-trend-as-a-single-value/m-p/258925#M77608</guid>
      <dc:creator>rajgowd1</dc:creator>
      <dc:date>2016-11-30T23:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to show current ERROR trend as a single value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-current-ERROR-trend-as-a-single-value/m-p/258926#M77609</link>
      <description>&lt;P&gt;Why not just add on a '| stats count'  or a '|stats count | table count' on the end, that would give you a count of the events you have found.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 23:13:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-show-current-ERROR-trend-as-a-single-value/m-p/258926#M77609</guid>
      <dc:creator>mrgibbon</dc:creator>
      <dc:date>2016-11-30T23:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to show current ERROR trend as a single value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-current-ERROR-trend-as-a-single-value/m-p/258927#M77610</link>
      <description>&lt;P&gt;HI,&lt;BR /&gt;
i would like to display and  want to change this so it shows the continuous last 60 minutes. So if the search is run at 17:00 the single value would show 15:00 to 16:00 and the trend arrow and value with compare is 14:00 to 15:00&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 23:27:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-show-current-ERROR-trend-as-a-single-value/m-p/258927#M77610</guid>
      <dc:creator>rajgowd1</dc:creator>
      <dc:date>2016-11-30T23:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to show current ERROR trend as a single value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-current-ERROR-trend-as-a-single-value/m-p/258928#M77611</link>
      <description>&lt;P&gt;Take a look here, it mentions a timechart command may produce the result you want:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.1/Viz/SingleValueFormatting"&gt;link text&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;So you may already have the code you need. Have you tried looking at the options for the trend in the xml?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 00:07:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-show-current-ERROR-trend-as-a-single-value/m-p/258928#M77611</guid>
      <dc:creator>mrgibbon</dc:creator>
      <dc:date>2016-12-01T00:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to show current ERROR trend as a single value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-current-ERROR-trend-as-a-single-value/m-p/258929#M77612</link>
      <description>&lt;P&gt;If you need trend to be based on last an hour before the current one you need to add the following earliest and latest time to your base search (i.e. &lt;STRONG&gt;last 2 hours&lt;/STRONG&gt;) &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;earliest&amp;gt;-2h@h&amp;lt;/earliest&amp;gt;
  &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your search query will change as following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex ERROR co_name=$co_name$ env_name=$env_name$ | timechart span=1h count 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then edit &lt;STRONG&gt;Compared to&lt;/STRONG&gt; to 1 hour before so that current hour stats are compared with previous hour for trending.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;option name="trendInterval"&amp;gt;-1h&amp;lt;/option&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This way you will current hour count as Single value and last hour count as trend indicator. &lt;/P&gt;

&lt;P&gt;PS: Timeline will be restricted to only last two hour as per your need, but you can set -2h@h to even earlier value like -4h@h (last 4 hours) or even -0d@d (beginning of the day) to show hourly sparlike in the trend indicator. However, trend interval will remain 1 hour and current hour will always be compared with previous hour as set in above code block.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 03:50:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-show-current-ERROR-trend-as-a-single-value/m-p/258929#M77612</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2016-12-01T03:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to show current ERROR trend as a single value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-current-ERROR-trend-as-a-single-value/m-p/258930#M77613</link>
      <description>&lt;P&gt;Thank you,i updated the search string based on your suggestion and its working perfectly&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 18:42:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-show-current-ERROR-trend-as-a-single-value/m-p/258930#M77613</guid>
      <dc:creator>rajgowd1</dc:creator>
      <dc:date>2016-12-01T18:42:46Z</dc:date>
    </item>
  </channel>
</rss>

