<?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 set x-axis time intervals for a line chart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-x-axis-time-intervals-for-a-line-chart/m-p/229689#M68035</link>
    <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; host=production source=madeup_source.csv (capture_time &amp;gt;= "08:30:00" AND capture_time &amp;lt;= "17:30:00") 
| eval pretend_everything_happened_today = capture_time . " " . strftime(now(), "%Y-%m-%d")
| eval _time = strptime(pretend_everything_happened_today , "%Y-%m-%d &amp;amp;H:%M:%S")
| timechart span=5m avg(capture_value) AS COUNT BY capture_date
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 02 Apr 2016 21:32:40 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2016-04-02T21:32:40Z</dc:date>
    <item>
      <title>How to set x-axis time intervals for a line chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-x-axis-time-intervals-for-a-line-chart/m-p/229684#M68030</link>
      <description>&lt;P&gt;I've read over all of the other variations of this question, but I haven't been able to make this work.&lt;/P&gt;

&lt;P&gt;I have a search that runs for the Last 7 days that checks for events between 08:30 and 17:30 and then charts out a numerical value known as 'capture_value'. The end goal is to have each date as its own line along the same time frame. The time value that is used is a field in the log file rather than _time, however, I have been able to modify the search to use &lt;CODE&gt;strftime(_time, "%H:%M:%S")&lt;/CODE&gt; and it works just the same. As the data comes in 5 minute increments, there are too many data points to display along the x-axis.&lt;/P&gt;

&lt;P&gt;Is it possible to change this to be every hour or 30 minutes? I have tried to make this work with a timechart, but it doesn't give the results broken down by date over time like I want.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=production source=madeup_source.csv (capture_time &amp;gt;= "08:30:00" AND capture_time &amp;lt;= "17:30:00") | chart values(capture_value) as COUNT by capture_time, capture_date useother=f limit=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/110188-splunk-mock.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:58:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-x-axis-time-intervals-for-a-line-chart/m-p/229684#M68030</guid>
      <dc:creator>AzySidhe</dc:creator>
      <dc:date>2020-09-29T08:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to set x-axis time intervals for a line chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-x-axis-time-intervals-for-a-line-chart/m-p/229685#M68031</link>
      <description>&lt;P&gt;I do not understand.  Are you saying that you would like each line on the line graph to represent a day (e.g. "today", "yesterday", "today-2", etc.)  If you will mock up a picture then I am sure that I can help you do this.  Your description is unclear to me.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 02:15:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-x-axis-time-intervals-for-a-line-chart/m-p/229685#M68031</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-03-02T02:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to set x-axis time intervals for a line chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-x-axis-time-intervals-for-a-line-chart/m-p/229686#M68032</link>
      <description>&lt;P&gt;have you tried&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;my awesome search | timechart span=30m count foo blah blah&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;span=30m will force Splunk to break into 30 minute segments&lt;/P&gt;

&lt;P&gt;is that what you mean?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 02:23:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-x-axis-time-intervals-for-a-line-chart/m-p/229686#M68032</guid>
      <dc:creator>0YAoNnmRmKDg</dc:creator>
      <dc:date>2016-03-02T02:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to set x-axis time intervals for a line chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-x-axis-time-intervals-for-a-line-chart/m-p/229687#M68033</link>
      <description>&lt;P&gt;Close, but not quite. I have tried that and while it does break it down, the x-axis remains the full 7 days instead of the 8:30 - 17:30&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2016 07:05:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-x-axis-time-intervals-for-a-line-chart/m-p/229687#M68033</guid>
      <dc:creator>AzySidhe</dc:creator>
      <dc:date>2016-03-06T07:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to set x-axis time intervals for a line chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-x-axis-time-intervals-for-a-line-chart/m-p/229688#M68034</link>
      <description>&lt;P&gt;I've added a picture of what I'm currently seeing. What I would like to see along the X-axis is hourly increments from 8:30 - 17:30 but I can't make it show. The data points are every 5 minutes which results in Splunk turning the labels off by default.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2016 07:19:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-x-axis-time-intervals-for-a-line-chart/m-p/229688#M68034</guid>
      <dc:creator>AzySidhe</dc:creator>
      <dc:date>2016-03-06T07:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to set x-axis time intervals for a line chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-x-axis-time-intervals-for-a-line-chart/m-p/229689#M68035</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; host=production source=madeup_source.csv (capture_time &amp;gt;= "08:30:00" AND capture_time &amp;lt;= "17:30:00") 
| eval pretend_everything_happened_today = capture_time . " " . strftime(now(), "%Y-%m-%d")
| eval _time = strptime(pretend_everything_happened_today , "%Y-%m-%d &amp;amp;H:%M:%S")
| timechart span=5m avg(capture_value) AS COUNT BY capture_date
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 02 Apr 2016 21:32:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-x-axis-time-intervals-for-a-line-chart/m-p/229689#M68035</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-04-02T21:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to set x-axis time intervals for a line chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-x-axis-time-intervals-for-a-line-chart/m-p/229690#M68036</link>
      <description>&lt;P&gt;Thank you so much! This set me on the right path! I had to modify the strptime a little as the date format was swapped (it needed to be "%H:%M:%S %Y-%m-%d") but this worked!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 19:35:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-x-axis-time-intervals-for-a-line-chart/m-p/229690#M68036</guid>
      <dc:creator>AzySidhe</dc:creator>
      <dc:date>2016-04-04T19:35:21Z</dc:date>
    </item>
  </channel>
</rss>

