<?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 get 3 different hours data in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309773#M92943</link>
    <description>&lt;P&gt;Its working now.But remaining all fields are also coming with no data.I want to display only my required fields in the statistics table&lt;/P&gt;</description>
    <pubDate>Thu, 25 May 2017 06:11:40 GMT</pubDate>
    <dc:creator>prathapkcsc</dc:creator>
    <dc:date>2017-05-25T06:11:40Z</dc:date>
    <item>
      <title>How to get 3 different hours data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309762#M92932</link>
      <description>&lt;P&gt;Hello everyone,&lt;BR /&gt;
my search looks like this,&lt;BR /&gt;
base search | reg " " | | bin _time as desired_times span=4h | | where _time = desired_times&lt;BR /&gt;
| table _time server CPU MEM DISK raw1 raw2.&lt;/P&gt;

&lt;P&gt;In where_time=desired_times,&lt;BR /&gt;
my desired timings are 8AM,12PM,18PM.&lt;BR /&gt;
How to give all 3 timings in that where clause?&lt;BR /&gt;
Anyone can help me?&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:11:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309762#M92932</guid>
      <dc:creator>prathapkcsc</dc:creator>
      <dc:date>2020-09-29T14:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different hours data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309763#M92933</link>
      <description>&lt;P&gt;It should ideally go in your base search using extracted field date_hour. However you have defined a span of 4 hours on _time. Do you want 8 AM to 12:00 PM 12:00 PM to 16:00 PM and from 18:00 PM to 22:00 PM?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt; Your base search &amp;gt; (date_hour&amp;gt;=08 AND date_hour&amp;lt;=16 ) OR (date_hour&amp;gt;=18 AND date_hour&amp;lt;=24 )
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 May 2017 06:46:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309763#M92933</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-05-24T06:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different hours data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309764#M92934</link>
      <description>&lt;P&gt;NO i want only 8AM,12PM,18PM data.&lt;BR /&gt;
my search looks like this &lt;BR /&gt;
your base search&lt;BR /&gt;
 | rex "(AM|PM)\s+(?[^,]+),\s+?(?[^,]+),\s+?(?[^,]+),\s+?(?[^,]+),\s+?(?\d+),\s+?(?\d+),\s+?(?\d+)"&lt;BR /&gt;
 | bin _time as desired_times span=4h&lt;BR /&gt;
 | where _time = desired_times&lt;BR /&gt;
 | table _time SERV NODE CPU MEM DISK&lt;/P&gt;

&lt;P&gt;now i want only 8AM,12PM,18PM data?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:11:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309764#M92934</guid>
      <dc:creator>prathapkcsc</dc:creator>
      <dc:date>2020-09-29T14:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different hours data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309765#M92935</link>
      <description>&lt;P&gt;Your code is getting escaped please post with Code button (101010). date_hour should still work... Following in the base search should give you event only from specific hours&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt; Your base search &amp;gt; (date_hour=08 OR date_hour=12  OR date_hour=18
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 May 2017 05:16:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309765#M92935</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-05-25T05:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different hours data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309766#M92936</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | reg " " |  bin _time as desired_times span=4h |  where strftime(desired_times,"%H")="08" OR strftime(desired_times,"%H")="12" OR strftime(desired_times,"%H")="18"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 May 2017 05:28:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309766#M92936</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-25T05:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different hours data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309767#M92937</link>
      <description>&lt;P&gt;i am not getting any events&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 05:53:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309767#M92937</guid>
      <dc:creator>prathapkcsc</dc:creator>
      <dc:date>2017-05-25T05:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different hours data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309768#M92938</link>
      <description>&lt;P&gt;How about this (the last where clause)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  where tonumber(strftime(desired_times,"%H"))=8 OR tonumber(strftime(desired_times,"%H"))=12 OR tonumber(strftime(desired_times,"%H"))=18
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 May 2017 05:59:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309768#M92938</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-25T05:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different hours data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309769#M92939</link>
      <description>&lt;P&gt;still no results found&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 06:00:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309769#M92939</guid>
      <dc:creator>prathapkcsc</dc:creator>
      <dc:date>2017-05-25T06:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different hours data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309770#M92940</link>
      <description>&lt;P&gt;its giving me the results but in table statistics all hours are displaying without data,&lt;BR /&gt;
I want to display only those 3 hrs in table statistics&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 06:02:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309770#M92940</guid>
      <dc:creator>prathapkcsc</dc:creator>
      <dc:date>2017-05-25T06:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different hours data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309771#M92941</link>
      <description>&lt;P&gt;Strange. What is your full query? You're getting events before the where clause?&lt;/P&gt;

&lt;P&gt;Try this as well&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | some regex | eval hour=tonumber(strftime(_time,"%H")) | where hour&amp;gt;=8 AND hour&amp;lt;=18
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 May 2017 06:04:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309771#M92941</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-25T06:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different hours data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309772#M92942</link>
      <description>&lt;P&gt;yes am getting the results with all hours of data.&lt;BR /&gt;
my  search query is &lt;BR /&gt;
base search&lt;BR /&gt;
|rex ".&lt;EM&gt;?(?[^,]+),\s&lt;/EM&gt;?(?[^,]+),\s*?(?[^,]+),\s*?(?[^,]+),\s*?(?\d+),\s*?(?\d+),\s*?(?\d+),\s*?(?\d+),\s*?(?\d+)"&lt;BR /&gt;
|bin _time as desired_times span=4h |  where tonumber(strftime(desired_times,"%H"))=8 OR tonumber(strftime(desired_times,"%H"))=12 OR tonumber(strftime(desired_times,"%H"))=18|table _time,server,DISK&lt;BR /&gt;
 | timechart limit=0 max(DISK) as DISK by server&lt;/P&gt;

&lt;P&gt;i included your suggession thats not giving any results&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:11:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309772#M92942</guid>
      <dc:creator>prathapkcsc</dc:creator>
      <dc:date>2020-09-29T14:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different hours data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309773#M92943</link>
      <description>&lt;P&gt;Its working now.But remaining all fields are also coming with no data.I want to display only my required fields in the statistics table&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 06:11:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309773#M92943</guid>
      <dc:creator>prathapkcsc</dc:creator>
      <dc:date>2017-05-25T06:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 3 different hours data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309774#M92944</link>
      <description>&lt;P&gt;Add a table command after the where clause.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| table list of fields that you want to show
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 May 2017 06:13:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-3-different-hours-data/m-p/309774#M92944</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-25T06:13:57Z</dc:date>
    </item>
  </channel>
</rss>

