<?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: Chart one value field and multiple value field within same time bucket in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361458#M106759</link>
    <description>&lt;P&gt;You can always UpVote, too.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Aug 2017 22:44:32 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-08-07T22:44:32Z</dc:date>
    <item>
      <title>Chart one value field and multiple value field within same time bucket</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361450#M106751</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
Thanks up front your time&lt;BR /&gt;
I have duration field generated from some &lt;CODE&gt;transaction&lt;/CODE&gt; command and I would love to draw a chart that presenting &lt;CODE&gt;avg()&lt;/CODE&gt;- one value within same time bucket and &lt;CODE&gt;values()&lt;/CODE&gt; - values that average is calculated. My search is :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;some search&amp;gt; | where duration &amp;gt; 10 
| bin _time span=1d| stats avg(duration) as avgDurs values(duration) as valDurs by _time,session_name | 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it is resulting following data set: (valDur has multiple values)&lt;BR /&gt;
_time| session_name | avgDurs | valDurs&lt;BR /&gt;
2017-04-26|s1|22.500000|12 33&lt;BR /&gt;
2017-04-27|s2|16.500000|11 14 30&lt;/P&gt;

&lt;P&gt;My question is how can i chart this table with&lt;BR /&gt;
single avgDurs line (it appears on all charts, issue is on multiple fields)&lt;BR /&gt;
and multiple values for valDurs on same chart&lt;BR /&gt;
&lt;STRONG&gt;within same time frame&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I tried couple other examples (xyseries) i found on answers and documentation. Here are my trials incase if i am missing something:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| bin _time span=1d| stats avg(duration) as avgDur values(duration) as valDur by session_name,_time 
| eval s1="AvgDurs ValDurs" |makemv s1 | mvexpand s1| eval yval=case(s1=="AvgDurs",avgDur, "ValDurs",valDur)| eval series=session_name+":"+s1 | xyseries _time, series, yval
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;please note that first stats without session name is closest to what is desired. it only display valDurs if there is only one value&lt;BR /&gt;
Thanks again&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:56:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361450#M106751</guid>
      <dc:creator>akocak</dc:creator>
      <dc:date>2020-09-29T13:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Chart one value field and multiple value field within same time bucket</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361451#M106752</link>
      <description>&lt;P&gt;If you wish to have a separate line for each value of duration, you may end up with bunch of lines (duration is a number and it can have any possible integer value). Any specific benefit that you see with showing all those duration values?&lt;/P&gt;

&lt;P&gt;Also, see if something like this would work &lt;/P&gt;

&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;some search&amp;gt; | where duration &amp;gt; 10 
| bin _time span=1d
| eval series=strftime(_time,"%m/%d/%Y")."##".session_name."##".avgDurs
| stats avg(duration) as avgDurs by series
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 May 2017 18:25:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361451#M106752</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-03T18:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Chart one value field and multiple value field within same time bucket</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361452#M106753</link>
      <description>&lt;P&gt;You cannot chart both (after all, what would the chart of the multi-valued field even look like; what would the units of the Y-Axis be?).  But you can make 2 charts from one search by using your search as a base search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;some search&amp;gt; | where duration &amp;gt; 10 
| bin _time span=1d
| stats avg(duration) as avgDurs values(duration) as valDurs BY _time session_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, in the panel that needs to have the chart, extend the base with a reference plus this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart span=1d first(avgDurs) AS avgDurs
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 May 2017 19:44:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361452#M106753</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-03T19:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Chart one value field and multiple value field within same time bucket</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361453#M106754</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/15147"&gt;@somesoni2&lt;/a&gt; , thanks for the quick response, I think i need to make it more clear, if this is a line timechart, &lt;BR /&gt;
within the same time window, I see avg as it is one value for each time window, however, duration values, they could be in same color (legend) too, just want to draw each. &lt;BR /&gt;
I checked your suggestion also, it didn't bring desired output, check this one, &lt;BR /&gt;
    |bin _time span=1d | eventstats avg(duration) as DailyAverage values(duration) as DurValues  by _time, session_name&lt;BR /&gt;
    |convert ctime(_time)| chart values(DurValues) values(DailyAverage) over session_name by _time useother=false&lt;/P&gt;

&lt;P&gt;output of this wrong as well, however closer, just need need to show each value , I am wondering if we can change _time span to 1h let's say and find a way in Timechart to show it daily still? &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:56:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361453#M106754</guid>
      <dc:creator>akocak</dc:creator>
      <dc:date>2020-09-29T13:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Chart one value field and multiple value field within same time bucket</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361454#M106755</link>
      <description>&lt;P&gt;Give this a try then&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;some search&amp;gt; | where duration &amp;gt; 10 
 | bin _time span=1d| stats avg(duration) as avgDurs values(duration) as valDurs by _time,session_name | mvexpand valDurs
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 May 2017 20:16:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361454#M106755</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-03T20:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Chart one value field and multiple value field within same time bucket</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361455#M106756</link>
      <description>&lt;P&gt;This works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thanks man, I knew it is one command away &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; mvexpand. &lt;/P&gt;

&lt;P&gt;thanks again, wish you a great day. I am not sure if i can validate it as correct answer here. &lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 20:23:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361455#M106756</guid>
      <dc:creator>akocak</dc:creator>
      <dc:date>2017-05-03T20:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Chart one value field and multiple value field within same time bucket</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361456#M106757</link>
      <description>&lt;P&gt;Here you go.&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 20:27:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361456#M106757</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-03T20:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Chart one value field and multiple value field within same time bucket</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361457#M106758</link>
      <description>&lt;P&gt;@woodcock , thanks for the answer, your answer is valid as well,however I didn't want to deal with flash charts in dashboard. Thanks for your time.&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 20:40:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361457#M106758</guid>
      <dc:creator>akocak</dc:creator>
      <dc:date>2017-05-03T20:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Chart one value field and multiple value field within same time bucket</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361458#M106759</link>
      <description>&lt;P&gt;You can always UpVote, too.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 22:44:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-one-value-field-and-multiple-value-field-within-same-time/m-p/361458#M106759</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-08-07T22:44:32Z</dc:date>
    </item>
  </channel>
</rss>

