<?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: Calculate hourly usage from Machine data in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Calculate-hourly-usage-from-Machine-data/m-p/560091#M159164</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/222349"&gt;@shashank_24&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try this for timechart?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;source="mydataarchive" host="splunkdev" index="test_index"
| eval timeFrameStart=timeFrameStart/1000, timeFrameEnd=timeFrameEnd/1000, usage=timeFrameEnd-timeFrameStart, _time=timeFrameStart
| timechart span=1h sum(usage) as usage sum(Visits) as Visits&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jul 2021 16:46:19 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2021-07-19T16:46:19Z</dc:date>
    <item>
      <title>Calculate hourly usage from Machine data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-hourly-usage-from-Machine-data/m-p/560073#M159156</link>
      <description>&lt;P&gt;Hi, I have uploaded a JSON data from one of my APM tools into Splunk to get some meaningful insights. The events are there for every hour. Every event has 2 fields&amp;nbsp;&lt;SPAN&gt;timeFrameStart &amp;amp;&amp;nbsp;timeFrameEnd which are coming as Epoch time and I have converted them into human readable format. There is another fields called Visits which tells me how many visits were there in that hour.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My requirement is to plot a hourly usage graph with time as x-axis (probably derive from&amp;nbsp;timeFrameStart field) and visits on the y-axis. I've written a base query -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;source="mydataarchive" host="splunkdev" index="test_index"
| eval startTime=strftime(timeFrameStart/1000,"%a,%d %b %Y %H:%M:%S") 
| eval endTime=strftime(timeFrameEnd/1000,"%a,%d %b %Y %H:%M:%S") 
| table startTime endTime visits&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if anyone can advice on this using stats or timechart command.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 14:51:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-hourly-usage-from-Machine-data/m-p/560073#M159156</guid>
      <dc:creator>shashank_24</dc:creator>
      <dc:date>2021-07-19T14:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate hourly usage from Machine data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-hourly-usage-from-Machine-data/m-p/560091#M159164</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/222349"&gt;@shashank_24&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try this for timechart?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;source="mydataarchive" host="splunkdev" index="test_index"
| eval timeFrameStart=timeFrameStart/1000, timeFrameEnd=timeFrameEnd/1000, usage=timeFrameEnd-timeFrameStart, _time=timeFrameStart
| timechart span=1h sum(usage) as usage sum(Visits) as Visits&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 16:46:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-hourly-usage-from-Machine-data/m-p/560091#M159164</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-07-19T16:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate hourly usage from Machine data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-hourly-usage-from-Machine-data/m-p/561068#M159474</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp; It's not working. What i want is hourly chart with visits on y-axis. &lt;EM&gt;_time&lt;/EM&gt; field is coming as index time which I don't want.&lt;/P&gt;&lt;P&gt;I want to plot against the time field&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;timeFrameStart&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Jul 2021 17:22:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-hourly-usage-from-Machine-data/m-p/561068#M159474</guid>
      <dc:creator>shashank_24</dc:creator>
      <dc:date>2021-07-27T17:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate hourly usage from Machine data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-hourly-usage-from-Machine-data/m-p/561140#M159489</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/222349"&gt;@shashank_24&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you observe the search I'm overwrite the _time by doing eval.&amp;nbsp;It isn't working?&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;_time=timeFrameStart&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 04:25:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-hourly-usage-from-Machine-data/m-p/561140#M159489</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-07-28T04:25:50Z</dc:date>
    </item>
  </channel>
</rss>

