<?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 to search for records between respective timezones? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-records-between-respective-timezones/m-p/643779#M223022</link>
    <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;search&lt;/FONT&gt; command cannot handle a field ("variable") name on both sides of the operator.&amp;nbsp; Use &lt;FONT face="courier new,courier"&gt;where&lt;/FONT&gt;, instead.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=ovpm sourcetype=ovpm_global
| search "Service Name" = "WSB EXPRESS"
| eval region = case(substr(SYSTEMNAME, 1, 2) == "my", "AP", substr(SYSTEMNAME, 1, 2) == "cz", "EU", substr(SYSTEMNAME, 1, 2) == "us", "AM", true(), "Other")
| eval regionStartHour = tonumber(case(substr(SYSTEMNAME, 1, 2) == "my", 0, substr(SYSTEMNAME, 1, 2) == "cz", 8, substr(SYSTEMNAME, 1, 2) == "us", 16, true(), 0))
| eval regionEndHour = tonumber(case(substr(SYSTEMNAME, 1, 2) == "my", 8, substr(SYSTEMNAME, 1, 2) == "cz", 16, substr(SYSTEMNAME, 1, 2) == "us", 24, true(), 0))
| eval hr = strftime(_time, "%H") 
| where hr&amp;gt;=regionStartHour AND hr&amp;lt;=regionEndHour&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 18 May 2023 14:08:25 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2023-05-18T14:08:25Z</dc:date>
    <item>
      <title>How to search for records between respective timezones?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-records-between-respective-timezones/m-p/643772#M223018</link>
      <description>&lt;P&gt;We have logs from multiple region, but only want to report those between respective regions working hours.&lt;BR /&gt;Created following query which works fine when putting an absolute number, but doesn't filter by variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;index=ovpm sourcetype=ovpm_global
| search "Service Name" = "WSB EXPRESS"
| eval region = case(substr(SYSTEMNAME, 1, 2) == "my", "AP", substr(SYSTEMNAME, 1, 2) == "cz", "EU", substr(SYSTEMNAME, 1, 2) == "us", "AM", true(), "Other")
| eval regionStartHour = tonumber(case(substr(SYSTEMNAME, 1, 2) == "my", 0, substr(SYSTEMNAME, 1, 2) == "cz", 8, substr(SYSTEMNAME, 1, 2) == "us", 16, true(), 0))
| eval regionEndHour = tonumber(case(substr(SYSTEMNAME, 1, 2) == "my", 8, substr(SYSTEMNAME, 1, 2) == "cz", 16, substr(SYSTEMNAME, 1, 2) == "us", 24, true(), 0))
| eval hr = strftime(_time, "%H") | search hr&amp;gt;=regionStartHour AND hr&amp;lt;=regionEndHour&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 13:09:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-records-between-respective-timezones/m-p/643772#M223018</guid>
      <dc:creator>ran_deep</dc:creator>
      <dc:date>2023-05-18T13:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for records between respective timezones?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-records-between-respective-timezones/m-p/643779#M223022</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;search&lt;/FONT&gt; command cannot handle a field ("variable") name on both sides of the operator.&amp;nbsp; Use &lt;FONT face="courier new,courier"&gt;where&lt;/FONT&gt;, instead.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=ovpm sourcetype=ovpm_global
| search "Service Name" = "WSB EXPRESS"
| eval region = case(substr(SYSTEMNAME, 1, 2) == "my", "AP", substr(SYSTEMNAME, 1, 2) == "cz", "EU", substr(SYSTEMNAME, 1, 2) == "us", "AM", true(), "Other")
| eval regionStartHour = tonumber(case(substr(SYSTEMNAME, 1, 2) == "my", 0, substr(SYSTEMNAME, 1, 2) == "cz", 8, substr(SYSTEMNAME, 1, 2) == "us", 16, true(), 0))
| eval regionEndHour = tonumber(case(substr(SYSTEMNAME, 1, 2) == "my", 8, substr(SYSTEMNAME, 1, 2) == "cz", 16, substr(SYSTEMNAME, 1, 2) == "us", 24, true(), 0))
| eval hr = strftime(_time, "%H") 
| where hr&amp;gt;=regionStartHour AND hr&amp;lt;=regionEndHour&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 18 May 2023 14:08:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-records-between-respective-timezones/m-p/643779#M223022</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-05-18T14:08:25Z</dc:date>
    </item>
  </channel>
</rss>

