<?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: Compare x hours vs last 1 week ago in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612244#M212870</link>
    <description>&lt;P&gt;How would that work if the user selected previous year, for example? What about "All time"? What about using the advanced setting? You probably need to think this through and decide / agree with your user what the precise requirement is.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Sep 2022 10:54:18 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-09-07T10:54:18Z</dc:date>
    <item>
      <title>Compare x hours vs last 1 week ago</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612213#M212852</link>
      <description>&lt;P&gt;@ITWhisper As per the Below Screenshot I want to add Custom time frame. Where user can able to select any time frame and compare the results.&lt;/P&gt;&lt;P&gt;Please help to understand the logic.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="uagraw01_0-1662538497321.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21351i10E8148CE80B87C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="uagraw01_0-1662538497321.png" alt="uagraw01_0-1662538497321.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 08:12:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612213#M212852</guid>
      <dc:creator>uagraw01</dc:creator>
      <dc:date>2022-09-07T08:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Compare x hours vs last 1 week ago</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612231#M212861</link>
      <description>&lt;P&gt;One way to do this is to have the corresponding string as the value for each of the labels in your custom time range selector. For example: last 15 minutes might have a value of "((earliest=@m-15m latest=@m) OR (earliest=@m-1w-15m latest=@m-1w))", then you just use the token in your search instead of the current setting&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 09:59:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612231#M212861</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-09-07T09:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Compare x hours vs last 1 week ago</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612233#M212862</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; As per below Where I need to use the token.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Current SPL is Like :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=ecomm_sfcc_prod sourcetype=sfcc_logs source="/mnt/webdav/*.log" "Order created successfully" $country_s1$ ((earliest=@m-$earliest_tok$ latest=@m) OR (earliest=@m-6d-$earliest_tok$ latest=@m-6d))&lt;BR /&gt;| rex field=_raw "Payment\s+Method\:\s(?&amp;lt;Payment_Method&amp;gt;[A-Za-z0-9.+]+)"&lt;BR /&gt;| rex field=_raw "Device\sType\:\s+(?&amp;lt;Device_Type&amp;gt;[A-Za-z0-9.+]+)"&lt;BR /&gt;| eval Device_Type=upper(Device_Type)&lt;BR /&gt;| search Device_Type="$Device_t$"&lt;BR /&gt;| eval date_hour=strftime(_time, "%H:%M%p %Z")&lt;BR /&gt;| eval time=date_hour&lt;BR /&gt;| eval date=date_month.":".date_mday&lt;BR /&gt;| chart count by time date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Current XML setting :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;input type="radio" token="period_tok" searchWhenChanged="true"&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Select a time range&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;choice value="5m"&amp;gt;Last 5 minute&amp;lt;/choice&amp;gt;&lt;BR /&gt;&amp;lt;choice value="15m"&amp;gt;Last 15 minute&amp;lt;/choice&amp;gt;&lt;BR /&gt;&amp;lt;choice value="60m"&amp;gt;Last 60 Minute&amp;lt;/choice&amp;gt;&lt;BR /&gt;&amp;lt;choice value="3h"&amp;gt;Last 3 hours&amp;lt;/choice&amp;gt;&lt;BR /&gt;&amp;lt;choice value="6h"&amp;gt;Last 6 hours&amp;lt;/choice&amp;gt;&lt;BR /&gt;&amp;lt;!-- set condition based on the label defined by &amp;lt;choice&amp;gt; --&amp;gt;&lt;BR /&gt;&amp;lt;!-- Within each condition, specify a custom label for display --&amp;gt;&lt;BR /&gt;&amp;lt;!-- Capture the selected value in the token, earliest_tok --&amp;gt;&lt;BR /&gt;&amp;lt;change&amp;gt;&lt;BR /&gt;&amp;lt;condition label="Last 60 Minute"&amp;gt;&lt;BR /&gt;&amp;lt;set token="date_label"&amp;gt;Last 60 minutes&amp;lt;/set&amp;gt;&lt;BR /&gt;&amp;lt;set token="earliest_tok"&amp;gt;$value$&amp;lt;/set&amp;gt;&lt;BR /&gt;&amp;lt;/condition&amp;gt;&lt;BR /&gt;&amp;lt;condition label="Last 6 hours"&amp;gt;&lt;BR /&gt;&amp;lt;set token="date_label"&amp;gt;Last 6 hours&amp;lt;/set&amp;gt;&lt;BR /&gt;&amp;lt;set token="earliest_tok"&amp;gt;$value$&amp;lt;/set&amp;gt;&lt;BR /&gt;&amp;lt;/condition&amp;gt;&lt;BR /&gt;&amp;lt;condition label="Last 3 hours"&amp;gt;&lt;BR /&gt;&amp;lt;set token="date_label"&amp;gt;Last 3 hours&amp;lt;/set&amp;gt;&lt;BR /&gt;&amp;lt;set token="earliest_tok"&amp;gt;$value$&amp;lt;/set&amp;gt;&lt;BR /&gt;&amp;lt;/condition&amp;gt;&lt;BR /&gt;&amp;lt;condition label="Last 5 minute"&amp;gt;&lt;BR /&gt;&amp;lt;set token="date_label"&amp;gt;Last 5 minutes&amp;lt;/set&amp;gt;&lt;BR /&gt;&amp;lt;set token="earliest_tok"&amp;gt;$value$&amp;lt;/set&amp;gt;&lt;BR /&gt;&amp;lt;/condition&amp;gt;&lt;BR /&gt;&amp;lt;condition label="Last 15 minute"&amp;gt;&lt;BR /&gt;&amp;lt;set token="date_label"&amp;gt;Last 15 minutes&amp;lt;/set&amp;gt;&lt;BR /&gt;&amp;lt;set token="earliest_tok"&amp;gt;$value$&amp;lt;/set&amp;gt;&lt;BR /&gt;&amp;lt;/condition&amp;gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 10:06:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612233#M212862</guid>
      <dc:creator>uagraw01</dc:creator>
      <dc:date>2022-09-07T10:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Compare x hours vs last 1 week ago</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612234#M212863</link>
      <description>&lt;P&gt;Does what you are doing not already work?&lt;/P&gt;&lt;P&gt;Setting earliest_tok is a bit superfluous as the value is already available in period_tok&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=ecomm_sfcc_prod sourcetype=sfcc_logs source="/mnt/webdav/*.log" "Order created successfully" $country_s1$ ((earliest=@m-$period_tok$ latest=@m) OR (earliest=@m-6d-$period_tok$ latest=@m-6d))
| rex field=_raw "Payment\s+Method\:\s(?&amp;lt;Payment_Method&amp;gt;[A-Za-z0-9.+]+)"
| rex field=_raw "Device\sType\:\s+(?&amp;lt;Device_Type&amp;gt;[A-Za-z0-9.+]+)"
| eval Device_Type=upper(Device_Type)
| search Device_Type="$Device_t$"
| eval date_hour=strftime(_time, "%H:%M%p %Z")
| eval time=date_hour
| eval date=date_month.":".date_mday
| chart count by time date&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 07 Sep 2022 10:21:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612234#M212863</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-09-07T10:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Compare x hours vs last 1 week ago</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612237#M212864</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;My previous token "&lt;SPAN&gt;earliest_tok" worked fine no issue I have faced, Here I am 5 custom time frame selector. As per the user he wants custom time frame from where he can select any time. Like 2 hours, 3 hours, 6 hours, 7 hours. Because Its tedious&amp;nbsp;for me create&amp;nbsp; multiple Time frames selector.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="uagraw01_0-1662546878689.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21356i12E0BFB8AFA67158/image-size/medium?v=v2&amp;amp;px=400" role="button" title="uagraw01_0-1662546878689.png" alt="uagraw01_0-1662546878689.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 10:32:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612237#M212864</guid>
      <dc:creator>uagraw01</dc:creator>
      <dc:date>2022-09-07T10:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Compare x hours vs last 1 week ago</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612238#M212865</link>
      <description>&lt;P&gt;You could just have a text input where the user puts 2h or 3h etc?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 10:35:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612238#M212865</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-09-07T10:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Compare x hours vs last 1 week ago</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612240#M212867</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;Can't we Create this time of time frame with the custom ones.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 10:38:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612240#M212867</guid>
      <dc:creator>uagraw01</dc:creator>
      <dc:date>2022-09-07T10:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: Compare x hours vs last 1 week ago</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612242#M212868</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can't we Create this time of time frame with the custom ones.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="uagraw01_0-1662547508024.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21357i2D01A8E7568FAB3D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="uagraw01_0-1662547508024.png" alt="uagraw01_0-1662547508024.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 10:40:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612242#M212868</guid>
      <dc:creator>uagraw01</dc:creator>
      <dc:date>2022-09-07T10:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Compare x hours vs last 1 week ago</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612244#M212870</link>
      <description>&lt;P&gt;How would that work if the user selected previous year, for example? What about "All time"? What about using the advanced setting? You probably need to think this through and decide / agree with your user what the precise requirement is.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 10:54:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612244#M212870</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-09-07T10:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Compare x hours vs last 1 week ago</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612259#M212875</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;I will verify with them.&lt;/P&gt;&lt;P&gt;Thanks for all your support&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 11:52:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-x-hours-vs-last-1-week-ago/m-p/612259#M212875</guid>
      <dc:creator>uagraw01</dc:creator>
      <dc:date>2022-09-07T11:52:04Z</dc:date>
    </item>
  </channel>
</rss>

