<?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 I edit my search to display two time charts in one graph? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285512#M86388</link>
    <description>&lt;P&gt;I am wondering if specifying explict earliest=... and latest=... with the appropriate snaps in both searches wouldn't help? Something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     host=xxx* "url1" earliest=-4h@h latest=@h| timechart span=30m p50(execute_time) AS xxx50 |appendcols [search host=yyy* "url2" earliest=-4h@h latest=@h | timechart span=30m p50(execute_time) AS yyy50]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 02 Jun 2016 13:01:32 GMT</pubDate>
    <dc:creator>gabriel_vasseur</dc:creator>
    <dc:date>2016-06-02T13:01:32Z</dc:date>
    <item>
      <title>How do I edit my search to display two time charts in one graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285511#M86387</link>
      <description>&lt;P&gt;I am using appendcols to put two timecharts in one graph to show the correlation, however, the values are off in different time buckets, which make the graph wrong.&lt;/P&gt;

&lt;P&gt;Here is my search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=xxx* "url1" | timechart span=30m p50(execute_time) AS xxx50 |appendcols [search host=yyy* "url2" | timechart span=30m p50(execute_time) AS yyy50]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is the result in table: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2016-06-01 08:00:00 5101.3962    
2016-06-01 08:30:00 2402.4924   3863
2016-06-01 09:00:00 2402.4924   1196
2016-06-01 09:30:00 7472.6874   958
2016-06-01 10:00:00 2932.9128   5953
2016-06-01 10:30:00 2449.2942   1181
2016-06-01 11:00:00 3088.9188   1140
2016-06-01 11:30:00 3135.7206   895
                                  880
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As you see the two values are off, the value 3863 should be aligned with 2016-06-01 08:00:00 instead of 2016-06-01 08:30:00 etc.&lt;/P&gt;

&lt;P&gt;What did I do wrong? or is there any other better way to achieve my goal?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 17:06:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285511#M86387</guid>
      <dc:creator>tinhuty</dc:creator>
      <dc:date>2016-06-01T17:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to display two time charts in one graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285512#M86388</link>
      <description>&lt;P&gt;I am wondering if specifying explict earliest=... and latest=... with the appropriate snaps in both searches wouldn't help? Something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     host=xxx* "url1" earliest=-4h@h latest=@h| timechart span=30m p50(execute_time) AS xxx50 |appendcols [search host=yyy* "url2" earliest=-4h@h latest=@h | timechart span=30m p50(execute_time) AS yyy50]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Jun 2016 13:01:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285512#M86388</guid>
      <dc:creator>gabriel_vasseur</dc:creator>
      <dc:date>2016-06-02T13:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to display two time charts in one graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285513#M86389</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
Why dont you keep it simple?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; (host=xxx* "url1") AND (host=yyy* "url2") |eval execute_time2=case(host=yyy*,execute_time)| timechart span=30m p50(execute_time) AS xxx50 |appendcols [search host=yyy* "url2" | timechart  span=30m p50(execute_time) AS xxx50, p50(execute_time2) AS yyy50]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
L&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 13:11:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285513#M86389</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2016-06-02T13:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to display two time charts in one graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285514#M86390</link>
      <description>&lt;P&gt;Try one of these options&lt;/P&gt;

&lt;P&gt;*&lt;STRONG&gt;&lt;EM&gt;Option 1&lt;/EM&gt;&lt;/STRONG&gt;*&lt;BR /&gt;
    (host=xxx* "url1") OR (host=yyy* "url2") | timechart span=30m p50(execute_time) AS exectime by host | rename * AS *50&lt;/P&gt;

&lt;P&gt;*&lt;STRONG&gt;&lt;EM&gt;Option 2&lt;/EM&gt;&lt;/STRONG&gt;*&lt;BR /&gt;
    host=xxx* "url1" | timechart span=30m p50(execute_time) AS xxx50 |append [search host=yyy* "url2" | timechart span=30m p50(execute_time) AS yyy50] | timechart span=30m first(*) as *&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:52:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285514#M86390</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2020-09-29T09:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to display two time charts in one graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285515#M86391</link>
      <description>&lt;P&gt;One clarification: host=xxx*  and host=yyy* are regular expression to match multiple host names, such as xxx001, xxx002, yyy111, yyy112 etc.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 15:36:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285515#M86391</guid>
      <dc:creator>tinhuty</dc:creator>
      <dc:date>2016-06-02T15:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to display two time charts in one graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285516#M86392</link>
      <description>&lt;P&gt;This worked actually. Not sure why it didn't work when I first try.&lt;/P&gt;

&lt;P&gt;However the time period is hard coded. It didn't work with timepicker if I put this in dashboard.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 18:27:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285516#M86392</guid>
      <dc:creator>tinhuty</dc:creator>
      <dc:date>2016-06-02T18:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to display two time charts in one graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285517#M86393</link>
      <description>&lt;P&gt;Thanks for the idea. Corrected a few spots and below works for me:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;(host=xxx* "url1") OR (host=yyy* "url2") |eval&lt;BR /&gt;
execute_time2=case(host==yyy11, execute_time)| timechart span=30m p50(execute_time)&lt;BR /&gt;
AS xxx50, p50(execute_time2) AS yyy50&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:50:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285517#M86393</guid>
      <dc:creator>tinhuty</dc:creator>
      <dc:date>2020-09-29T09:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to display two time charts in one graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285518#M86394</link>
      <description>&lt;P&gt;Looks that regular express match for host doesn't work on case statement, so need to spell out all host names.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 21:52:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285518#M86394</guid>
      <dc:creator>tinhuty</dc:creator>
      <dc:date>2016-06-02T21:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to display two time charts in one graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285519#M86395</link>
      <description>&lt;P&gt;To use a regex inside case() you need to use the match function. Something like that:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...=case( match(host, "^yyy"), ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You could also use the simpler like operator:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...=case( like(host, "yyy%"), ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note that "yyy*" in your initial search is a pattern but not a regular expression. "yyy*" as a regex will match something slightly different!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:53:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285519#M86395</guid>
      <dc:creator>gabriel_vasseur</dc:creator>
      <dc:date>2020-09-29T09:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to display two time charts in one graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285520#M86396</link>
      <description>&lt;P&gt;Was option 2 truncated somehow? It ends with "first() as"...&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 07:21:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285520#M86396</guid>
      <dc:creator>gabriel_vasseur</dc:creator>
      <dc:date>2016-06-03T07:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to display two time charts in one graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285521#M86397</link>
      <description>&lt;P&gt;True! I guess you could change your dashboard to a form and use tokens for earliest and latest, but you're probably better off with one of the other answers contributed on this page...&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 07:23:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285521#M86397</guid>
      <dc:creator>gabriel_vasseur</dc:creator>
      <dc:date>2016-06-03T07:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to display two time charts in one graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285522#M86398</link>
      <description>&lt;P&gt;works great, thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 18:56:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-display-two-time-charts-in-one-graph/m-p/285522#M86398</guid>
      <dc:creator>tinhuty</dc:creator>
      <dc:date>2016-06-03T18:56:08Z</dc:date>
    </item>
  </channel>
</rss>

