<?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 you make output from xyseries generate the same _time-based X-axis labels as timechart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-make-output-from-xyseries-generate-the-same-time/m-p/229412#M67930</link>
    <description>&lt;P&gt;Thank you, @Jeremiah! That works for me.&lt;/P&gt;

&lt;P&gt;I've removed the &lt;CODE&gt;span=1s&lt;/CODE&gt;option after reading the docs: &lt;CODE&gt;bucket&lt;/CODE&gt; (and &lt;CODE&gt;bin&lt;/CODE&gt;) seem to share the same default spanning behavior as &lt;CODE&gt;timechart&lt;/CODE&gt;. I've also replaced the &lt;CODE&gt;bucket&lt;/CODE&gt; command name with &lt;CODE&gt;bin&lt;/CODE&gt;, because - tell me if I'm wrong - the &lt;CODE&gt;bin&lt;/CODE&gt; command seems to be the "primary" command (for which &lt;CODE&gt;bucket&lt;/CODE&gt; is an alias): the Splunk docs topic for &lt;CODE&gt;bucket&lt;/CODE&gt; refers the reader to the &lt;CODE&gt;bin&lt;/CODE&gt; topic.&lt;/P&gt;

&lt;P&gt;I'd like to convert your comment into an answer so that I can accept it, but I can't see how to do that. I'm guessing I lack the authority - or karma points - for that option to appear in my user interface. Could you (or anyone reading this) please do that for me, or point me to where I can do that myself?&lt;/P&gt;

&lt;P&gt;So, pushing &lt;CODE&gt;timechart&lt;/CODE&gt; to the end of the search solves my problem. I'm still curious, though: &lt;CODE&gt;timechart&lt;/CODE&gt; seems to be "doing stuff under the covers" (perhaps: generating "internal use only fields" that Splunk "hides" from users?) that I do not (yet?) have the wit to see.&lt;/P&gt;</description>
    <pubDate>Tue, 03 May 2016 06:12:54 GMT</pubDate>
    <dc:creator>Graham_Hanningt</dc:creator>
    <dc:date>2016-05-03T06:12:54Z</dc:date>
    <item>
      <title>How do you make output from xyseries generate the same _time-based X-axis labels as timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-make-output-from-xyseries-generate-the-same-time/m-p/229410#M67928</link>
      <description>&lt;P&gt;The following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=my_log_type | timechart count by conn_type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;generates the chart I want, with one exception: instead of the original conn_type (connection type) values, I want the chart to display more readable, descriptive values.&lt;/P&gt;

&lt;P&gt;I want to replace the values &lt;EM&gt;after&lt;/EM&gt; the &lt;CODE&gt;timechart&lt;/CODE&gt; command. For reasons why, see my &lt;A href="https://answers.splunk.com/answers/396921/can-a-search-string-dynamically-build-commands-and.html#comment-397073"&gt;comment&lt;/A&gt; on a different question.&lt;/P&gt;

&lt;P&gt;To rename the series, I append the following commands to the original search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| untable _time conn_type value | lookup connection_types.csv conn_type output description | xyseries _time description value
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This has the desired effect of renaming the series, but the resulting chart lacks the intelligently formatted X-axis values generated by &lt;CODE&gt;timechart&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;How do I reproduce the intelligent X-axis values generated by &lt;CODE&gt;timechart&lt;/CODE&gt;?&lt;/P&gt;

&lt;P&gt;I do &lt;EM&gt;not&lt;/EM&gt; want to hardcode span or bin values: I use this search in a dashboard whose time range might span years or fractions of a second. I want to take advantage of the way &lt;CODE&gt;timechart&lt;/CODE&gt; chooses a default span based on the time range.&lt;/P&gt;

&lt;P&gt;The following screenshots show the original "intelligent" X-axis labels generated by &lt;CODE&gt;timechart&lt;/CODE&gt;, and the X-axis labels after &lt;CODE&gt;xyseries&lt;/CODE&gt;:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Splunk screenshots"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1305i319C0E27291E9C59/image-size/large?v=v2&amp;amp;px=999" role="button" title="Splunk screenshots" alt="Splunk screenshots" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 04:51:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-make-output-from-xyseries-generate-the-same-time/m-p/229410#M67928</guid>
      <dc:creator>Graham_Hanningt</dc:creator>
      <dc:date>2016-05-03T04:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do you make output from xyseries generate the same _time-based X-axis labels as timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-make-output-from-xyseries-generate-the-same-time/m-p/229411#M67929</link>
      <description>&lt;P&gt;What about doing a stats and then a timechart?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=my_log_type | bucket _time span=1s | stats count by _time, conn_type | lookup connection_types.csv conn_type output description | timechart sum(count) AS count by description
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 May 2016 05:05:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-make-output-from-xyseries-generate-the-same-time/m-p/229411#M67929</guid>
      <dc:creator>Jeremiah</dc:creator>
      <dc:date>2016-05-03T05:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do you make output from xyseries generate the same _time-based X-axis labels as timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-make-output-from-xyseries-generate-the-same-time/m-p/229412#M67930</link>
      <description>&lt;P&gt;Thank you, @Jeremiah! That works for me.&lt;/P&gt;

&lt;P&gt;I've removed the &lt;CODE&gt;span=1s&lt;/CODE&gt;option after reading the docs: &lt;CODE&gt;bucket&lt;/CODE&gt; (and &lt;CODE&gt;bin&lt;/CODE&gt;) seem to share the same default spanning behavior as &lt;CODE&gt;timechart&lt;/CODE&gt;. I've also replaced the &lt;CODE&gt;bucket&lt;/CODE&gt; command name with &lt;CODE&gt;bin&lt;/CODE&gt;, because - tell me if I'm wrong - the &lt;CODE&gt;bin&lt;/CODE&gt; command seems to be the "primary" command (for which &lt;CODE&gt;bucket&lt;/CODE&gt; is an alias): the Splunk docs topic for &lt;CODE&gt;bucket&lt;/CODE&gt; refers the reader to the &lt;CODE&gt;bin&lt;/CODE&gt; topic.&lt;/P&gt;

&lt;P&gt;I'd like to convert your comment into an answer so that I can accept it, but I can't see how to do that. I'm guessing I lack the authority - or karma points - for that option to appear in my user interface. Could you (or anyone reading this) please do that for me, or point me to where I can do that myself?&lt;/P&gt;

&lt;P&gt;So, pushing &lt;CODE&gt;timechart&lt;/CODE&gt; to the end of the search solves my problem. I'm still curious, though: &lt;CODE&gt;timechart&lt;/CODE&gt; seems to be "doing stuff under the covers" (perhaps: generating "internal use only fields" that Splunk "hides" from users?) that I do not (yet?) have the wit to see.&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 06:12:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-make-output-from-xyseries-generate-the-same-time/m-p/229412#M67930</guid>
      <dc:creator>Graham_Hanningt</dc:creator>
      <dc:date>2016-05-03T06:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do you make output from xyseries generate the same _time-based X-axis labels as timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-make-output-from-xyseries-generate-the-same-time/m-p/229413#M67931</link>
      <description>&lt;P&gt;Looks like it is now an answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; accept away!&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 17:33:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-make-output-from-xyseries-generate-the-same-time/m-p/229413#M67931</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2016-05-03T17:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do you make output from xyseries generate the same _time-based X-axis labels as timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-make-output-from-xyseries-generate-the-same-time/m-p/229414#M67932</link>
      <description>&lt;P&gt;I personally can not use timechart. Is there a way to do what timechart is doing with xyseries ?&lt;/P&gt;

&lt;P&gt;EDIT: I found a solution:&lt;/P&gt;

&lt;P&gt;I perform the xyseries, then the "untable", and then the timechart... But it really not efficient and optimized. That would be great to know exactly what the timechart command is doing...&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 10:04:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-make-output-from-xyseries-generate-the-same-time/m-p/229414#M67932</guid>
      <dc:creator>ctaf</dc:creator>
      <dc:date>2017-07-11T10:04:38Z</dc:date>
    </item>
  </channel>
</rss>

