<?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: Inputlookup trend for 24hrs,7 days showing same graph in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-trend-for-24hrs-7-days-showing-same-graph/m-p/474923#M133523</link>
    <description>&lt;P&gt;Hi Arjun&lt;/P&gt;

&lt;P&gt;Thanks for your response!&lt;BR /&gt;
However the trend for last 24hrs showing similar to 7 days ( Mean even If I opt the last 24hrs in time window)&lt;BR /&gt;
Please let me know how to pickup the last 24hrs data from the input lookup.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2019 03:39:54 GMT</pubDate>
    <dc:creator>gopiven</dc:creator>
    <dc:date>2019-11-06T03:39:54Z</dc:date>
    <item>
      <title>Inputlookup trend for 24hrs,7 days showing same graph</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-trend-for-24hrs-7-days-showing-same-graph/m-p/474921#M133521</link>
      <description>&lt;P&gt;Hi experts!&lt;/P&gt;

&lt;P&gt;Since I am new to Splunk, I understand that we cannot use a time chart with inputlookup(?).&lt;BR /&gt;
But I am using (outputlookup + scheduled report) concept to run every hr and using that as inputlookup in the dashboard to draw the trends for 24 hrs and 7 days.&lt;/P&gt;

&lt;P&gt;Here the format of the lookup:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Inputlookup name: customerslog.csv&lt;BR /&gt;
Userid  Clientid    date_year   date_month  date_mday   date_wday   date_hour   date_minute channel&lt;BR /&gt;
abc1    clientid1   2019    november    1   friday  17  55  ONLINE&lt;BR /&gt;
abc2    clientid2   2019    november    1   friday  19  25  MOBILE&lt;BR /&gt;
abc3    clientid1   2019    october 31  thursday    11  44  ONLINE&lt;BR /&gt;
abc4    clientid1   2019    november    1   friday  13  26  MOBILE&lt;BR /&gt;
abc5    clientid2   2019    october 31  thursday    12  4   MOBILE&lt;BR /&gt;
abc6    clientid2   2019    november    2   saturday    16  23  MOBILE&lt;BR /&gt;
abc7    clientid1   2019    november    1   friday  18  2   MOBILE&lt;BR /&gt;
abc8    clientid2   2019    november    1   friday  17  53  MOBILE&lt;BR /&gt;
abc9    clientid2   2019    october 31  thursday    11  47  MOBILE&lt;BR /&gt;
abc10   clientid2   2019    november    1   friday  20  14  ONLINE&lt;BR /&gt;
abc11   clientid1   2019    october 30  wednesday   19  10  MOBILE&lt;BR /&gt;
abc12   clientid2   2019    november    1   friday  18  3   ONLINE&lt;BR /&gt;
abc13   clientid2   2019    november    1   friday  12  1   MOBILE&lt;BR /&gt;
abc14   clientid2   2019    november    1   friday  19  26  MOBILE&lt;BR /&gt;
abc15   clientid1   2019    november    1   friday  11  59  ONLINE&lt;BR /&gt;
abc16   clientid2   2019    october 31  thursday    11  45  MOBILE&lt;BR /&gt;
abc17   clientid1   2019    october 31  thursday    12  8   MOBILE&lt;BR /&gt;
abc18   clientid2   2019    october 30  wednesday   11  56  MOBILE&lt;BR /&gt;
abc19   clientid1   2019    october 30  wednesday   16  57  ONLINE&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I would like to show the clientid volume as AVERAGE VOLUME FOR LAST 7 days and Userid volume for last 24 hrs with respect to current time with interval (span=15m) by using the same above inputlookup.&lt;/P&gt;

&lt;P&gt;To show the average of Client volume across the channel for last 7 days :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup customerslog.csv | dedup clientid | stats count(clientid) AS CLIENTS by date_hour, date_wday, channel | chart eval(round(avg(CLIENT),0)) AS "AVERAGE NO.OF CLIENTS LOGGED IN" over date_hour by Channel
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To show the trend for last 24 hrs:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;|inputlookup customerslog.csv | stats count(Userid) AS USERSONLY by date_hour, date_wday, channel | chart eval(round(avg(USERSOLNY),0)) AS "AVERAGE NO.OF USERS LOGGED IN" over date_hour by Channel&lt;/CODE&gt;  --&amp;gt; this is giving same result similar to 7 days trend &lt;BR /&gt;
&lt;CODE&gt;|inputlookup customerslog.csv | timechart avg(USERONLY) span=15m&lt;/CODE&gt; --&amp;gt; Not Working&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;|inputlookup customerslog.csv  where earliest=-24h@h latest=now |  timechart sum(Userid) as USERSONLY  by channel&lt;/CODE&gt; --&amp;gt; Not working&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup customerslog.csv | timechart span=15m sum(Userid) As "USERSONLY" by channel --&amp;gt; Not working
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Should I really use earliest and now for the 24hrs trend? &lt;/P&gt;

&lt;P&gt;Kindly help me with this please and share the search if you have?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:48:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-trend-for-24hrs-7-days-showing-same-graph/m-p/474921#M133521</guid>
      <dc:creator>gopiven</dc:creator>
      <dc:date>2020-09-30T02:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup trend for 24hrs,7 days showing same graph</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-trend-for-24hrs-7-days-showing-same-graph/m-p/474922#M133522</link>
      <description>&lt;P&gt;timechart requires _time variable. So you need to convert your date fields to an epoch timestamp.&lt;/P&gt;

&lt;P&gt;Here's how&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup customerslog.csv
| strcat date_year "-" date_month "-" date_mday " " date_hour ":" date_minute timestamp
| eval _time=strptime(timestamp, "%Y-%B-%d %H:%M")
| timechart avg(USERONLY) span=15m
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The important part is this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| strcat date_year "-" date_month "-" date_mday " " date_hour ":" date_minute timestamp
| eval _time=strptime(timestamp, "%Y-%B-%d %H:%M")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this, you are concatenating your different date columns to a single timestamp column and then your're converting that timestamp to an epoch timestamp and assigning it to _time using strptime. I've just used one of your searches as an example. You need to apply this to all your other searches.&lt;/P&gt;

&lt;P&gt;If you need to build a different format string for your strptime, you can use this - &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Commontimeformatvariables"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Commontimeformatvariables&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps&lt;BR /&gt;
Cheers&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 12:42:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-trend-for-24hrs-7-days-showing-same-graph/m-p/474922#M133522</guid>
      <dc:creator>arjunpkishore5</dc:creator>
      <dc:date>2019-11-04T12:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup trend for 24hrs,7 days showing same graph</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-trend-for-24hrs-7-days-showing-same-graph/m-p/474923#M133523</link>
      <description>&lt;P&gt;Hi Arjun&lt;/P&gt;

&lt;P&gt;Thanks for your response!&lt;BR /&gt;
However the trend for last 24hrs showing similar to 7 days ( Mean even If I opt the last 24hrs in time window)&lt;BR /&gt;
Please let me know how to pickup the last 24hrs data from the input lookup.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 03:39:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-trend-for-24hrs-7-days-showing-same-graph/m-p/474923#M133523</guid>
      <dc:creator>gopiven</dc:creator>
      <dc:date>2019-11-06T03:39:54Z</dc:date>
    </item>
  </channel>
</rss>

