<?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: search adding instead of representing a trend in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/search-adding-instead-of-representing-a-trend/m-p/221051#M188142</link>
    <description>&lt;P&gt;Try using trendline:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="X" sourcetype="Y" DOMAIN="ACTIVE_USER" | lookup host_lookup HOSTNAME OUTPUT SYSTEM | dedup HOSTNAME,ACTIVE_USER | where ACTIVE_USER!="NO_USER" | timechart span=5m dc(ACTIVE_USER) as "active_users" | trendline sma5(active_users)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.4.2/SearchReference/Trendline"&gt;https://docs.splunk.com/Documentation/Splunk/6.4.2/SearchReference/Trendline&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Also two comments on your search, first, you don't seem to be using the value from the lookup (SYSTEM).  And second, it doesn't seem necessary to dedup by hostname,active_user when you are using dc (which give you a distinct count of active users).&lt;/P&gt;</description>
    <pubDate>Wed, 10 Aug 2016 02:25:38 GMT</pubDate>
    <dc:creator>Jeremiah</dc:creator>
    <dc:date>2016-08-10T02:25:38Z</dc:date>
    <item>
      <title>search adding instead of representing a trend</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-adding-instead-of-representing-a-trend/m-p/221050#M188141</link>
      <description>&lt;P&gt;I'm trying to rectify a search where the chart should represent a Trend but is actually just adding the last active user and the current active user and showing it in the Trend Column :&lt;BR /&gt;
eg :&lt;BR /&gt;
2016-08-10 11:10:00 17  17&lt;BR /&gt;
2016-08-10 11:15:00 20  37&lt;BR /&gt;
2016-08-10 11:20:00 0   37&lt;/P&gt;

&lt;P&gt;search :&lt;/P&gt;

&lt;P&gt;index="X" sourcetype="Y" DOMAIN="ACTIVE_USER" | lookup host_lookup HOSTNAME OUTPUT SYSTEM | dedup HOSTNAME,ACTIVE_USER | where ACTIVE_USER!="NO_USER" | timechart span=5m dc(ACTIVE_USER) as "Active User Count" | addtotals | streamstats sum(Total) as "Trend"  | fields - Total&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:34:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-adding-instead-of-representing-a-trend/m-p/221050#M188141</guid>
      <dc:creator>Esky73</dc:creator>
      <dc:date>2020-09-29T10:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: search adding instead of representing a trend</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-adding-instead-of-representing-a-trend/m-p/221051#M188142</link>
      <description>&lt;P&gt;Try using trendline:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="X" sourcetype="Y" DOMAIN="ACTIVE_USER" | lookup host_lookup HOSTNAME OUTPUT SYSTEM | dedup HOSTNAME,ACTIVE_USER | where ACTIVE_USER!="NO_USER" | timechart span=5m dc(ACTIVE_USER) as "active_users" | trendline sma5(active_users)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.4.2/SearchReference/Trendline"&gt;https://docs.splunk.com/Documentation/Splunk/6.4.2/SearchReference/Trendline&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Also two comments on your search, first, you don't seem to be using the value from the lookup (SYSTEM).  And second, it doesn't seem necessary to dedup by hostname,active_user when you are using dc (which give you a distinct count of active users).&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 02:25:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-adding-instead-of-representing-a-trend/m-p/221051#M188142</guid>
      <dc:creator>Jeremiah</dc:creator>
      <dc:date>2016-08-10T02:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: search adding instead of representing a trend</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-adding-instead-of-representing-a-trend/m-p/221052#M188143</link>
      <description>&lt;P&gt;Thanks for your help&lt;/P&gt;

&lt;P&gt;The lookup file OUTPUT isn't a field in the csv (HOSTNAME and SERVER exist) but as we aren't using those values not sure why we are using it ?&lt;/P&gt;

&lt;P&gt;If dc(ACTIVE_USER) is used then no need to dedup right ? so i will remove that.&lt;/P&gt;

&lt;P&gt;So my search looks like so ..&lt;/P&gt;

&lt;P&gt;index="X" sourcetype="Y" DOMAIN=ACTIVE_USER | lookup host_lookup HOSTNAME OUTPUT SYSTEM | where ACTIVE_USER!="NO_USER" | timechart span=5m dc(ACTIVE_USER) as "Active User Count" | trendline sma5("Active User Count") AS Trend&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:34:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-adding-instead-of-representing-a-trend/m-p/221052#M188143</guid>
      <dc:creator>Esky73</dc:creator>
      <dc:date>2020-09-29T10:34:23Z</dc:date>
    </item>
  </channel>
</rss>

