<?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 combine three (x,y) coord series into one graph? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403748#M26447</link>
    <description>&lt;P&gt;@dhruv101 - that is a very different question.  You should probably  post a new question with those specific needs, and hope for an answer from one of my colleagues that specializes in dashboard behavior.&lt;/P&gt;</description>
    <pubDate>Sat, 30 Jun 2018 20:23:15 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2018-06-30T20:23:15Z</dc:date>
    <item>
      <title>How to combine three (x,y) coord series into one graph?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403740#M26439</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have 3 simple graphs generated by these three queries respectively&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=“app_event” | eval starttime = strftime ($$payload.beginVal$$, “%F %T.%9Q”) | chart count(starttime) as BeginVal by starttime 

index=“app_event” | eval endtime  = strftime ($$payload.endVal$$, “%F %T.%9Q”) | chart count(endtime) as EndVal by endtime

index=“app_event” | eval otherttime = strftime ($$payload.anotherVal$$, “%F %T.%9Q”) | chart count(othertime) as OtherVal by othertime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The count values are always 1. So coords can be assumed to be like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1. (1,1) , (3,1) (7,1)
2. (2,1), (5,1) (11,1)
3. (4,1), (8,1)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to merge these three charts into one chart by x axis value such that resultant chart looks like&lt;BR /&gt;
&lt;CODE&gt;(1,1) (2,1) (3,1) (4,1) (5,1) (7,1)&lt;/CODE&gt; and so on. But when I hover over the bar columns I want to be able to know the source of th column that is, is it BeginVal, EndVal or OtherVal.&lt;/P&gt;

&lt;P&gt;Could someone please help me with the query.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 00:41:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403740#M26439</guid>
      <dc:creator>dhruv101</dc:creator>
      <dc:date>2018-06-26T00:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine three (x,y) coord series into one graph?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403741#M26440</link>
      <description>&lt;P&gt;Seems like you are overcomplicating your life.  &lt;/P&gt;

&lt;P&gt;Try something like this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=“app_event” 
| eval myFan=mvrange(0,3)
| mvexpand myFan
| eval _time=case(myFan=0,$$payload.beginVal$$, myFan=1,$$payload.endVal$$, myFan=2,$$payload.anotherVal$$)
| eval phase=case(myFan=0,"Start", myFan=1,"End", myFan=2,"Other")
| timechart count by phase
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above assumes that the phase time values were epoch times (or your &lt;CODE&gt;strftime&lt;/CODE&gt; would not have worked)&lt;/P&gt;

&lt;P&gt;If &lt;CODE&gt;timechart&lt;/CODE&gt; won't work for your purposes, you can do this as well... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Time= strftime (_time, “%F %T.%9Q”)
| chart count by Time phase
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;... although you can choose the order, TIme phase or phase time, and so on.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 16:57:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403741#M26440</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-06-26T16:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine three (x,y) coord series into one graph?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403742#M26441</link>
      <description>&lt;P&gt;Thanks DalJeanis, this worked out. Now lets say "other" comes from a different index. How would we modify the query then? Should we use multisearch? &lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 17:16:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403742#M26441</guid>
      <dc:creator>dhruv101</dc:creator>
      <dc:date>2018-06-26T17:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine three (x,y) coord series into one graph?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403743#M26442</link>
      <description>&lt;P&gt;Hey DalJeanis, could you also briefly explain the code you have written? I dont clearly understand why we need the myFan variable and what case(myFan=0) evaluates to since its not myFan == 0, but rather an assignment. Thanks, I would really appreciate your help.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 21:39:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403743#M26442</guid>
      <dc:creator>dhruv101</dc:creator>
      <dc:date>2018-06-26T21:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine three (x,y) coord series into one graph?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403744#M26443</link>
      <description>&lt;P&gt;@dhruv101 - luckily, splunk can &lt;STRONG&gt;only&lt;/STRONG&gt; do assignment in the context of an &lt;CODE&gt;eval&lt;/CODE&gt; or stats-type aggregate function use, so that code is just an equality test.  Splunk will let you code the test as &lt;CODE&gt;=&lt;/CODE&gt; or &lt;CODE&gt;==&lt;/CODE&gt; in almost all cases.  (You are right that &lt;CODE&gt;==&lt;/CODE&gt; is unambiguous, so please feel free to code it that way.)&lt;/P&gt;

&lt;P&gt;'myFan', in combination with the &lt;CODE&gt;mvexpand&lt;/CODE&gt; verb, is one method of turning a single event into 3 events.  &lt;CODE&gt;mvrange(0,3)&lt;/CODE&gt; produces a field that has three values - &lt;CODE&gt;(0,1,2)&lt;/CODE&gt;.  &lt;CODE&gt;Mvexpand&lt;/CODE&gt; then produces three events, one with each value.  Multivalue fields are indexed using a zero base, so I'm in the habit of starting at zero.  In this case, it could have been &lt;CODE&gt;mvrange(17,20)&lt;/CODE&gt; and would have produced a different three values &lt;CODE&gt;(17,18,19)&lt;/CODE&gt;.  The rest of the code creates a different kind of record for each value of myFan.&lt;/P&gt;

&lt;P&gt;Here, we've reset the value of &lt;CODE&gt;_time&lt;/CODE&gt; to a different thing for each type of record... that's the main reason why we couldn't just do the &lt;CODE&gt;timechart&lt;/CODE&gt; all without splitting up the records.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 15:03:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403744#M26443</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-06-27T15:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine three (x,y) coord series into one graph?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403745#M26444</link>
      <description>&lt;P&gt;You can if you want, but it isn't needed.   You just OR together whatever you need before the first pipe. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ( index=“app_event” ... any other search terms to narrow the first kind of record ...) OR
 ( index=“foo”  ... any other search terms to narrow the second kind of record ...)
 | fields ...list all the fields that you need from either kind of record...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Jun 2018 15:05:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403745#M26444</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-06-27T15:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine three (x,y) coord series into one graph?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403746#M26445</link>
      <description>&lt;P&gt;I see. Thanks a lot for the detailed explanation @DalJeanis! &lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 17:08:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403746#M26445</guid>
      <dc:creator>dhruv101</dc:creator>
      <dc:date>2018-06-27T17:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine three (x,y) coord series into one graph?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403747#M26446</link>
      <description>&lt;P&gt;Hey @DalJeanis&lt;BR /&gt;
When we hover over the chart columns it shows the phase name and the count(as expected). Is it possible to add more labels to the column? I want to be able to see the value of $$payload.eventID$$ for each column. It is guaranteed that for all columns(with count 1 or more) the payload.eventID will be the same. &lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 18:50:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403747#M26446</guid>
      <dc:creator>dhruv101</dc:creator>
      <dc:date>2018-06-28T18:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine three (x,y) coord series into one graph?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403748#M26447</link>
      <description>&lt;P&gt;@dhruv101 - that is a very different question.  You should probably  post a new question with those specific needs, and hope for an answer from one of my colleagues that specializes in dashboard behavior.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jun 2018 20:23:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403748#M26447</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-06-30T20:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine three (x,y) coord series into one graph?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403749#M26448</link>
      <description>&lt;P&gt;Sounds good. Thanks so much!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2018 19:07:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-combine-three-x-y-coord-series-into-one-graph/m-p/403749#M26448</guid>
      <dc:creator>dhruv101</dc:creator>
      <dc:date>2018-07-02T19:07:12Z</dc:date>
    </item>
  </channel>
</rss>

