<?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 How to make a time chart with a list of time values I extracted with rex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-time-chart-with-a-list-of-time-values-I-extracted/m-p/269209#M80954</link>
    <description>&lt;P&gt;I have timestamps in my logs like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[23/Oct/2016:23:56:00 --0700]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I extracted them from my log files with this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=* * | rex field=_raw "(?ism)\[(?&amp;lt;time&amp;gt;\d+\/\w+\/.+)\]"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I want to make a timechart that shows the time on the x-axis and the number of occurrences in that time on the y-axis. I tried doing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart span=1h count by time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But that didn't give me what I wanted. In plain English, I want it to read like "you got a 100 requests from 9am-10am, 50 requests from 10am-11am, etc etc".&lt;/P&gt;

&lt;P&gt;Bonus: I would like to offer more granularity based on what the user wants. Like they should be able to see that they got a 100 requests from 9am-10am, but then see specifically at what times between that hour the 100 requests came in. &lt;/P&gt;</description>
    <pubDate>Thu, 08 Dec 2016 20:25:08 GMT</pubDate>
    <dc:creator>sankarms</dc:creator>
    <dc:date>2016-12-08T20:25:08Z</dc:date>
    <item>
      <title>How to make a time chart with a list of time values I extracted with rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-time-chart-with-a-list-of-time-values-I-extracted/m-p/269209#M80954</link>
      <description>&lt;P&gt;I have timestamps in my logs like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[23/Oct/2016:23:56:00 --0700]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I extracted them from my log files with this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=* * | rex field=_raw "(?ism)\[(?&amp;lt;time&amp;gt;\d+\/\w+\/.+)\]"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I want to make a timechart that shows the time on the x-axis and the number of occurrences in that time on the y-axis. I tried doing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart span=1h count by time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But that didn't give me what I wanted. In plain English, I want it to read like "you got a 100 requests from 9am-10am, 50 requests from 10am-11am, etc etc".&lt;/P&gt;

&lt;P&gt;Bonus: I would like to offer more granularity based on what the user wants. Like they should be able to see that they got a 100 requests from 9am-10am, but then see specifically at what times between that hour the 100 requests came in. &lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2016 20:25:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-time-chart-with-a-list-of-time-values-I-extracted/m-p/269209#M80954</guid>
      <dc:creator>sankarms</dc:creator>
      <dc:date>2016-12-08T20:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a time chart with a list of time values I extracted with rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-time-chart-with-a-list-of-time-values-I-extracted/m-p/269210#M80955</link>
      <description>&lt;P&gt;Try converting your extracted timefield to epoch using strptime (appropriate for your time value, below is just an example) and cast that to _time directly to do your timechart&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval test=strptime(time,"%d/%b/%Y:%H:%M")|eval _time=test|timechart span=1h count 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Dec 2016 20:33:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-time-chart-with-a-list-of-time-values-I-extracted/m-p/269210#M80955</guid>
      <dc:creator>Flynt</dc:creator>
      <dc:date>2016-12-08T20:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a time chart with a list of time values I extracted with rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-time-chart-with-a-list-of-time-values-I-extracted/m-p/269211#M80956</link>
      <description>&lt;P&gt;What does &lt;CODE&gt;_time=test&lt;/CODE&gt; mean?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2016 20:40:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-time-chart-with-a-list-of-time-values-I-extracted/m-p/269211#M80956</guid>
      <dc:creator>sankarms</dc:creator>
      <dc:date>2016-12-08T20:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a time chart with a list of time values I extracted with rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-time-chart-with-a-list-of-time-values-I-extracted/m-p/269212#M80957</link>
      <description>&lt;P&gt;This means set _time to the value of test which is an epoch value we created from the strptime statement.&lt;/P&gt;

&lt;P&gt;Test is just an arbitrary field name I gave it. _time is Splunk internal timefield that is used when doing timechart.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2016 20:51:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-time-chart-with-a-list-of-time-values-I-extracted/m-p/269212#M80957</guid>
      <dc:creator>Flynt</dc:creator>
      <dc:date>2016-12-08T20:51:49Z</dc:date>
    </item>
  </channel>
</rss>

