<?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 do I modify the label for x-axis? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-label-for-x-axis/m-p/319339#M95473</link>
    <description>&lt;P&gt;It's timechart that changes the dates to it's own format from the strptime format. As far as I know there's no way in search to customize that. You can go a different route and bin _time, use xyseries, and finally change the format after:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup lookup.csv
|eval _time=strptime(Week, "%d %b %y")
|bin _time span=1w
|xyseries _time Status Number
|eval _time=strftime(_time, "Week ending %d %b")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 26 May 2017 20:14:11 GMT</pubDate>
    <dc:creator>kellewic</dc:creator>
    <dc:date>2017-05-26T20:14:11Z</dc:date>
    <item>
      <title>How do I modify the label for x-axis?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-label-for-x-axis/m-p/319338#M95472</link>
      <description>&lt;P&gt;I have a lookup table similar to the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Week                   Status                     Number
13 May 17                Open                       5
13 May 17                Closed                     3
20 May 17                Open                       7
20 May 17                Closed                     4
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I built a timechart using the following syntax:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup lookup.csv | eval _time=strptime(Week, "%d %b %y") | timechart span=1w Values(Number) by Status 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That produces a line graph timechart, but the x-axis labels are changed: &lt;/P&gt;

&lt;P&gt;Mon 8 May&lt;BR /&gt;
Mon 15 May&lt;/P&gt;

&lt;P&gt;What am I not understanding about the strptime command that it's changing the date?&lt;/P&gt;

&lt;P&gt;And most importantly, how do I make the change the x-axis label to say something like "Week ending 13 May", "Week ending 20 May"&lt;/P&gt;

&lt;P&gt;I looked at the timewrap command but &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup lookup.csv | eval _time=strptime(Week, "%d %b %y") | timewrap w | timechart span=1w Values(Number) by Status 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;gives me a chart with four data points all on the left y-axis point "Mon May 22":&lt;/P&gt;

&lt;P&gt;"Closed, 2 weeks before", "Open, 2 weeks before", "Closed, 1 week before", "Open, 1 week before".  &lt;/P&gt;

&lt;P&gt;I need two lines with two data points like I get with the first search.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 16:39:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-label-for-x-axis/m-p/319338#M95472</guid>
      <dc:creator>reswob4</dc:creator>
      <dc:date>2017-05-26T16:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the label for x-axis?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-label-for-x-axis/m-p/319339#M95473</link>
      <description>&lt;P&gt;It's timechart that changes the dates to it's own format from the strptime format. As far as I know there's no way in search to customize that. You can go a different route and bin _time, use xyseries, and finally change the format after:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup lookup.csv
|eval _time=strptime(Week, "%d %b %y")
|bin _time span=1w
|xyseries _time Status Number
|eval _time=strftime(_time, "Week ending %d %b")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 May 2017 20:14:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-label-for-x-axis/m-p/319339#M95473</guid>
      <dc:creator>kellewic</dc:creator>
      <dc:date>2017-05-26T20:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the label for x-axis?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-label-for-x-axis/m-p/319340#M95474</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval raw="13 May 17,Open,5
13 May 17,Closed,3
20 May 17,Open,7
20 May 17,Closed,4" 
| makemv delim="
" raw 
| mvexpand raw 
| rename raw AS _raw 
| rex "^(?&amp;lt;Week&amp;gt;[^,]+),(?&amp;lt;Status&amp;gt;[^,]+),(?&amp;lt;Number&amp;gt;.*)$" 
| table Week Status Number

| rename COMMENT AS "Everything above creates test events; everything below is your solution"

| chart sum(Number) OVER Week BY Status
| eval _time=strptime(Week, "%d %b %y") 
| sort 0 _time
| fields - _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 27 May 2017 08:04:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-label-for-x-axis/m-p/319340#M95474</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-27T08:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify the label for x-axis?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-label-for-x-axis/m-p/319341#M95475</link>
      <description>&lt;P&gt;Thanks.  That worked great.&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 15:43:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-modify-the-label-for-x-axis/m-p/319341#M95475</guid>
      <dc:creator>reswob4</dc:creator>
      <dc:date>2017-05-31T15:43:14Z</dc:date>
    </item>
  </channel>
</rss>

