<?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 How to properly display trend comparison of values over Hour by Day for multiple days? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-properly-display-trend-comparison-of-values-over-Hour-by/m-p/462887#M130526</link>
    <description>&lt;P&gt;The following query will display a simple chart for trend comparison. This works well if you keep the days you're comparing =&amp;lt; 4 days.&lt;BR /&gt;
The Query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="my_index"
| search src="all_sources" 
| bin _time as Time
| eval Day=strftime(Time,"%m-%d")
| eval Hour=strftime(Time,"%H") 
| chart eval(round(avg(transfer_duration), 2)) as AvgXferDuration over Hour by Day
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above query will produce the following graph. (as long as its =&amp;lt; 4 days)&lt;/P&gt;

&lt;P&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/8072i51E49D8E681415D2/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;Now, if you increase the days to &amp;gt; 4 days. For example, if you want to see a week's trend (7 days). You will get the following graph. Notice the graph lines become scattered points in the center. (not sure why this happens)&lt;/P&gt;

&lt;P&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/8073i17A4B34E42C6A203/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;&lt;STRONG&gt;What is the proper way to display the graph for multiple days? e.g. &amp;gt; 4 days, 7 days, etc.&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Dec 2019 00:52:55 GMT</pubDate>
    <dc:creator>ten_yard_fight</dc:creator>
    <dc:date>2019-12-17T00:52:55Z</dc:date>
    <item>
      <title>How to properly display trend comparison of values over Hour by Day for multiple days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-properly-display-trend-comparison-of-values-over-Hour-by/m-p/462887#M130526</link>
      <description>&lt;P&gt;The following query will display a simple chart for trend comparison. This works well if you keep the days you're comparing =&amp;lt; 4 days.&lt;BR /&gt;
The Query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="my_index"
| search src="all_sources" 
| bin _time as Time
| eval Day=strftime(Time,"%m-%d")
| eval Hour=strftime(Time,"%H") 
| chart eval(round(avg(transfer_duration), 2)) as AvgXferDuration over Hour by Day
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above query will produce the following graph. (as long as its =&amp;lt; 4 days)&lt;/P&gt;

&lt;P&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/8072i51E49D8E681415D2/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;Now, if you increase the days to &amp;gt; 4 days. For example, if you want to see a week's trend (7 days). You will get the following graph. Notice the graph lines become scattered points in the center. (not sure why this happens)&lt;/P&gt;

&lt;P&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/8073i17A4B34E42C6A203/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;&lt;STRONG&gt;What is the proper way to display the graph for multiple days? e.g. &amp;gt; 4 days, 7 days, etc.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 00:52:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-properly-display-trend-comparison-of-values-over-Hour-by/m-p/462887#M130526</guid>
      <dc:creator>ten_yard_fight</dc:creator>
      <dc:date>2019-12-17T00:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to properly display trend comparison of values over Hour by Day for multiple days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-properly-display-trend-comparison-of-values-over-Hour-by/m-p/462888#M130527</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults count=2 
| streamstats count 
| eval _time = if (count==2,relative_time(_time,"-2month@d"), relative_time(_time,"@d")) 
| makecontinuous _time span=15min 
| eval transfer_duration=random() % 3.50 + .5 

| rename COMMENT AS "Everything above generates sample event data; everything below is your solution." 

| eval Day=strftime(_time,"%m-%d") 
| eval Hour=strftime(_time,"%H") 

| rename COMMENT AS "this is key logic" 

| where _time &amp;gt;relative_time(now(),"-7d@d") 

| chart eval(round(avg(transfer_duration), 2)) as AvgXferDuration over Hour by Day
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Dec 2019 12:48:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-properly-display-trend-comparison-of-values-over-Hour-by/m-p/462888#M130527</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-17T12:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to properly display trend comparison of values over Hour by Day for multiple days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-properly-display-trend-comparison-of-values-over-Hour-by/m-p/462889#M130528</link>
      <description>&lt;P&gt;Thank you very much @to4kawa . I see where my issue was. Your example helped me pay attention to the details.&lt;BR /&gt;
Turns out if I DO NOT bin _time, but instead remove it from my query, the chart command processes my transform correctly.&lt;/P&gt;

&lt;P&gt;Again, thank you for your suggestion. Please enjoy some of my karma.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 18:36:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-properly-display-trend-comparison-of-values-over-Hour-by/m-p/462889#M130528</guid>
      <dc:creator>ten_yard_fight</dc:creator>
      <dc:date>2019-12-17T18:36:01Z</dc:date>
    </item>
  </channel>
</rss>

