<?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 Creating a graph with two columns of a table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294506#M88887</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I need to make a simple line chart with the values of two columns of a table. the first column is the x axis and the second column is the y axis. At the meeting point of the two columns on the graph I need to represent with a dot, and to connect with a line between the dots. &lt;BR /&gt;
Here is an example of the result I need:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2689i9CAA7E4BEC337235/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;In this example I need the opposite. The dates should be on the x axis and the values should be on the y axis.&lt;/P&gt;

&lt;P&gt;Here is the code I am using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputcsv MPSMilstonesCSV 
| sort TaskDeadline 
| fieldformat TaskDeadline = strftime(TaskDeadline, "%d/%m/%Y") 
| table Report_Milestone TaskDeadline
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I don't know if i should use xyseries or timechart or a regular chart.&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Sun, 26 Mar 2017 22:17:40 GMT</pubDate>
    <dc:creator>matansocher</dc:creator>
    <dc:date>2017-03-26T22:17:40Z</dc:date>
    <item>
      <title>Creating a graph with two columns of a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294506#M88887</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I need to make a simple line chart with the values of two columns of a table. the first column is the x axis and the second column is the y axis. At the meeting point of the two columns on the graph I need to represent with a dot, and to connect with a line between the dots. &lt;BR /&gt;
Here is an example of the result I need:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2689i9CAA7E4BEC337235/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;In this example I need the opposite. The dates should be on the x axis and the values should be on the y axis.&lt;/P&gt;

&lt;P&gt;Here is the code I am using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputcsv MPSMilstonesCSV 
| sort TaskDeadline 
| fieldformat TaskDeadline = strftime(TaskDeadline, "%d/%m/%Y") 
| table Report_Milestone TaskDeadline
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I don't know if i should use xyseries or timechart or a regular chart.&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2017 22:17:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294506#M88887</guid>
      <dc:creator>matansocher</dc:creator>
      <dc:date>2017-03-26T22:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a graph with two columns of a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294507#M88888</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputcsv MPSMilstonesCSV
| sort TaskDeadline
| fieldformat TaskDeadline = strftime(TaskDeadline, "%d/%m/%Y")
| rename TaskDeadline AS _time
| table Report_Milestone TaskDeadline
| timechart avg(Report_Milestone)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Mar 2017 00:08:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294507#M88888</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-27T00:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a graph with two columns of a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294508#M88889</link>
      <description>&lt;P&gt;the following code does not help me.&lt;BR /&gt;
I did not understand why I should take the average in the timechart.&lt;BR /&gt;
Also, the result doesn't give me the x axis as dates and the y axis as the names of the milestones(Report_Milestone).&lt;/P&gt;

&lt;P&gt;Is there any other way to try this?&lt;/P&gt;

&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 12:32:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294508#M88889</guid>
      <dc:creator>matansocher</dc:creator>
      <dc:date>2017-03-27T12:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a graph with two columns of a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294509#M88890</link>
      <description>&lt;P&gt;Assuming TaskDeadline is in epoch (based on usage of strftime in your question), try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputcsv MPSMilstonesCSV 
 | sort TaskDeadline | eval _time=TaskDeadline 
 | fieldformat _time=strftime(_time, "%d/%m/%Y") 
 | table  _time Report_Milestone
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Mar 2017 15:06:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294509#M88890</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-27T15:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a graph with two columns of a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294510#M88891</link>
      <description>&lt;P&gt;The query that you are suggesting really gives me the table I need, but not the chart I need.&lt;/P&gt;

&lt;P&gt;Is there a way to create a chart like that?&lt;/P&gt;

&lt;P&gt;&lt;A href="http://imgur.com/a/OlXHQ"&gt;http://imgur.com/a/OlXHQ&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 21:22:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294510#M88891</guid>
      <dc:creator>matansocher</dc:creator>
      <dc:date>2017-03-27T21:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a graph with two columns of a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294511#M88892</link>
      <description>&lt;P&gt;That link has no image that I can see.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 00:45:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294511#M88892</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-28T00:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a graph with two columns of a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294512#M88893</link>
      <description>&lt;P&gt;&lt;A href="http://i67.tinypic.com/2195k06.png"&gt;http://i67.tinypic.com/2195k06.png&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I need the opposite - the y axis should be the values (milestones) and the x axis should be the dates.&lt;BR /&gt;
thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 07:16:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294512#M88893</guid>
      <dc:creator>matansocher</dc:creator>
      <dc:date>2017-03-28T07:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a graph with two columns of a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294513#M88894</link>
      <description>&lt;P&gt;You are using the wrong terms.  When you say &lt;CODE&gt;X-axis&lt;/CODE&gt; in Splunkytown, everyone thinks that you are referring to the &lt;CODE&gt;Visualizations&lt;/CODE&gt; tab and on that tab, you need the data formatted as I created in my answer.&lt;BR /&gt;
I see now that when you say &lt;CODE&gt;X-axis&lt;/CODE&gt; that you mean &lt;CODE&gt;columns&lt;/CODE&gt; which is the term in Splunkytown that would cause us to think 'Statistics` tab.  Now that I know what you are asking, check my latest answer (writing it now).&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 00:52:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294513#M88894</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-29T00:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a graph with two columns of a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294514#M88895</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputcsv MPSMilstonesCSV
| eval _time = strftime(TaskDeadline, "%d/%m/%Y")
| timechart span=1d avg(Report_Milestone)
| untable _time Report_Milestone count
| eval _time = strftime(_time, "%m/%d/%Y")
| xyseries Report_Milestone _time count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You might replace &lt;CODE&gt;avg&lt;/CODE&gt; with &lt;CODE&gt;first&lt;/CODE&gt; or &lt;CODE&gt;sum&lt;/CODE&gt; but there has to be some kind of aggregating function when you use &lt;CODE&gt;timechart&lt;/CODE&gt; (whether you "need one" or not).  If you are sure that there is always 0 or 1 value for each Report_Milestone each day, then you can use &lt;CODE&gt;first&lt;/CODE&gt;, but it is safest to use &lt;CODE&gt;avg&lt;/CODE&gt;, just in case.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 01:00:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-graph-with-two-columns-of-a-table/m-p/294514#M88895</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-29T01:00:08Z</dc:date>
    </item>
  </channel>
</rss>

