<?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 Overlay value in time chart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Overlay-value-in-time-chart/m-p/493035#M137510</link>
    <description>&lt;P&gt;There are multiple programs running every day and I want to visualise the volume and duration of each program by day.&lt;/P&gt;

&lt;P&gt;The data looks like this : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; _time, programtype, volume, daily
 20/01/2020,program1,8000,5444
 20/01/2020,program2,8000,1224
 21/01/2020,program1,1000,1123
 21/01/2020,program2,1000,1122
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If i use a timechart, (e.g. &lt;CODE&gt;| timechart span=1d values(volume) sum(duration) by programtype&lt;/CODE&gt; to display the data, I would get 4 graphs being shown. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;VolumeProgram1
VolumeProgram2
DurationProgram1
DurationProgram2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What i want to show is, 3 graphs with the volume being generic. &lt;BR /&gt;
*All programs will always have the same volume on the day. &lt;BR /&gt;
How would the query look like if i want to show :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Volume
DurationProgram1
DurationProgram2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a way to merge the data ? &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 18 Mar 2020 17:49:46 GMT</pubDate>
    <dc:creator>tanasami</dc:creator>
    <dc:date>2020-03-18T17:49:46Z</dc:date>
    <item>
      <title>Overlay value in time chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overlay-value-in-time-chart/m-p/493035#M137510</link>
      <description>&lt;P&gt;There are multiple programs running every day and I want to visualise the volume and duration of each program by day.&lt;/P&gt;

&lt;P&gt;The data looks like this : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; _time, programtype, volume, daily
 20/01/2020,program1,8000,5444
 20/01/2020,program2,8000,1224
 21/01/2020,program1,1000,1123
 21/01/2020,program2,1000,1122
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If i use a timechart, (e.g. &lt;CODE&gt;| timechart span=1d values(volume) sum(duration) by programtype&lt;/CODE&gt; to display the data, I would get 4 graphs being shown. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;VolumeProgram1
VolumeProgram2
DurationProgram1
DurationProgram2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What i want to show is, 3 graphs with the volume being generic. &lt;BR /&gt;
*All programs will always have the same volume on the day. &lt;BR /&gt;
How would the query look like if i want to show :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Volume
DurationProgram1
DurationProgram2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a way to merge the data ? &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 17:49:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overlay-value-in-time-chart/m-p/493035#M137510</guid>
      <dc:creator>tanasami</dc:creator>
      <dc:date>2020-03-18T17:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Overlay value in time chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overlay-value-in-time-chart/m-p/493036#M137511</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;|makeresults
| eval _raw="_time, programtype, volume, daily
20/01/2020,program1,8000,5444
20/01/2020,program2,8000,1224
21/01/2020,program1,1000,1123
21/01/2020,program2,1000,1122"
| rex mode=sed "s/(?m)^\s+//g"
| multikv forceheader=1
| eval _time=strptime(time,"%d/%m/%Y")
| table _time, programtype, volume, daily
| rename COMMENT as "this is sample you provide. From here, the logic"
| timechart span=1d values(volume) as volume sum(daily) as duration by programtype sep=""
| foreach volume* [ eval Volume = max('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;') ]
| rename duration* as *
| fields - volume*
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Mar 2020 18:51:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overlay-value-in-time-chart/m-p/493036#M137511</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-03-18T18:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Overlay value in time chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Overlay-value-in-time-chart/m-p/493037#M137512</link>
      <description>&lt;P&gt;First of all, &lt;CODE&gt;values()&lt;/CODE&gt; is not a proper &lt;CODE&gt;aggregation function&lt;/CODE&gt; for &lt;CODE&gt;timechart&lt;/CODE&gt; and it really should give you an error (if it does not, that is a bug on Splunk's part), so let's start by switching to &lt;CODE&gt;avg()&lt;/CODE&gt; (you might prefer &lt;CODE&gt;max()&lt;/CODE&gt; or something else).  So try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart span=1d avg(volume) AS volume sum(duration) AS duration BY programtype
| eval volume = 0
| foreach "volume:*" [ eval volume = volume + '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;' | fields - "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;" ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is a run-anywhere example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults | eval _raw="_time          programtype  volume    daily
20/01/2020     program1     8000      5444
20/01/2020     program2     8000      1224
21/01/2020     program1     1000      1123
21/01/2020     program2     1000      1122"
| multikv forceheader=1
| eval _time = strptime(time, "%d/%m/%Y")
| rename daily AS duration
| timechart fixedrange=f span=1d avg(volume) AS volume sum(duration) AS duration BY programtype
| eval volume = 0
| foreach "volume:*" [ eval volume = volume + '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;' | fields - "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;" ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 Mar 2020 19:26:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Overlay-value-in-time-chart/m-p/493037#M137512</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-03-22T19:26:40Z</dc:date>
    </item>
  </channel>
</rss>

