<?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 can i filter my output to display only the user results which satisfies the condition substraction of the fields **A and B** is greater than 3 hours.  Where A and B are the epoch times converted to human readable time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237140#M70479</link>
    <description>&lt;P&gt;The output I'm getting currently with the above query is as below.&lt;/P&gt;

&lt;P&gt;user_id       yesterday         average_of_last_7days   standard_deviation_of_last_7days&lt;BR /&gt;
A                06:16--05:13   14:04--03:40                             02:45--04:57&lt;BR /&gt;
B                07:08--05:20   14:06--03:51                         03:04--04:54&lt;BR /&gt;
C                13:45--05:24   17:57--04:00                             01:33--04:54&lt;BR /&gt;
D                05:29--05:28   20:23--14:39                         07:27--07:34&lt;BR /&gt;
E                05:10--05:10   05:10--05:10                             01:00--01:00&lt;BR /&gt;
F                 12:11--12:11  12:11--12:11                              01:00--01:00&lt;/P&gt;

&lt;P&gt;I am expection the output should contain only the time in between 19:00 PM to 6:00 AM of next day and also satifying the condition on my question.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 11:52:08 GMT</pubDate>
    <dc:creator>pavanae</dc:creator>
    <dc:date>2020-09-29T11:52:08Z</dc:date>
    <item>
      <title>how can i filter my output to display only the user results which satisfies the condition substraction of the fields **A and B** is greater than 3 hours.  Where A and B are the epoch times converted to human readable time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237138#M70477</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;

&lt;P&gt;Since I dont have much knowledge on Splunk query language. I am struggling for the past one week to sort out the results from a splunk query which is described as below.&lt;/P&gt;

&lt;P&gt;I want to define the "normal" time a user is working on Yesterday. This time-interval has to be between 18:00 day1 and 06:00 day2. Similarly for 7 consequent days  I have to calculate his average working time range for the last 7 days which should be between 18:00 day1 and 06:00 day2 like we trying for yesterday. &lt;/P&gt;

&lt;P&gt;And display them both.&lt;/P&gt;

&lt;P&gt;I have acheived somewhat with the help of some of the splunksters in this site with the following Splunk Query&lt;/P&gt;

&lt;P&gt;For some reason I couldn't able post my complete query so pasting a picture.  please check the picture for my splunk query.&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/173279-query2.png" alt="alt text" /&gt;    &lt;/P&gt;

&lt;P&gt;how can i filter my output to display only the user results which satisfies the condition substraction of the fields &lt;STRONG&gt;a_e and y_e&lt;/STRONG&gt; is greater than 3 hours. &lt;/P&gt;

&lt;P&gt;Where a_e and y_e are the epoch times converted to human readable time.&lt;/P&gt;

&lt;P&gt;I know that I have been posting simillar questions for the past 1 week but due to my Unformulated English I failed to explain what I'm exactly looking for. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:52:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237138#M70477</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2020-09-29T11:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: how can i filter my output to display only the user results which satisfies the condition substraction of the fields **A and B** is greater than 3 hours.  Where A and B are the epoch times converted to human readable time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237139#M70478</link>
      <description>&lt;P&gt;If you give an example of output from current query and some sample of how you want it to be arranged, it will be useful for others to assist.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 17:05:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237139#M70478</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2016-11-23T17:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: how can i filter my output to display only the user results which satisfies the condition substraction of the fields **A and B** is greater than 3 hours.  Where A and B are the epoch times converted to human readable time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237140#M70479</link>
      <description>&lt;P&gt;The output I'm getting currently with the above query is as below.&lt;/P&gt;

&lt;P&gt;user_id       yesterday         average_of_last_7days   standard_deviation_of_last_7days&lt;BR /&gt;
A                06:16--05:13   14:04--03:40                             02:45--04:57&lt;BR /&gt;
B                07:08--05:20   14:06--03:51                         03:04--04:54&lt;BR /&gt;
C                13:45--05:24   17:57--04:00                             01:33--04:54&lt;BR /&gt;
D                05:29--05:28   20:23--14:39                         07:27--07:34&lt;BR /&gt;
E                05:10--05:10   05:10--05:10                             01:00--01:00&lt;BR /&gt;
F                 12:11--12:11  12:11--12:11                              01:00--01:00&lt;/P&gt;

&lt;P&gt;I am expection the output should contain only the time in between 19:00 PM to 6:00 AM of next day and also satifying the condition on my question.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:52:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237140#M70479</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2020-09-29T11:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: how can i filter my output to display only the user results which satisfies the condition substraction of the fields **A and B** is greater than 3 hours.  Where A and B are the epoch times converted to human readable time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237141#M70480</link>
      <description>&lt;P&gt;Try this. The only changes to your original query are the &lt;CODE&gt;| where strftime(_time, "%H") &amp;gt;=18 OR hod&amp;lt;=6&lt;/CODE&gt; AND &lt;CODE&gt;| where (a_e-y_e)&amp;gt;=1800&lt;/CODE&gt; rest of your query remains the same. I have mocked up your query with &lt;CODE&gt;...&lt;/CODE&gt; inserting only the changes at relevant places in your query. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-7d@d 
| eval hod=strftime(_time, "%H")
| where hod&amp;gt;=18 OR hod&amp;lt;=6
| eval days=... 
| eval when=...
| stats ...
| stats ...
| where (a_e-y_e)&amp;gt;=1800
| convert ctime(a*)  ...
| rest of your original query here
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Nov 2016 20:37:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237141#M70480</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-11-23T20:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: how can i filter my output to display only the user results which satisfies the condition substraction of the fields **A and B** is greater than 3 hours.  Where A and B are the epoch times converted to human readable time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237142#M70481</link>
      <description>&lt;P&gt;Thank you very much @sundareshr. Got an error while executing the search with your suggested changes.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;"Error in 'where' command: Typechecking failed. The '&amp;gt;=' operator received different types."&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 20:46:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237142#M70481</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2016-11-23T20:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: how can i filter my output to display only the user results which satisfies the condition substraction of the fields **A and B** is greater than 3 hours.  Where A and B are the epoch times converted to human readable time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237143#M70482</link>
      <description>&lt;P&gt;My bad, try the updated search&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 20:51:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237143#M70482</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-11-23T20:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: how can i filter my output to display only the user results which satisfies the condition substraction of the fields **A and B** is greater than 3 hours.  Where A and B are the epoch times converted to human readable time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237144#M70483</link>
      <description>&lt;P&gt;thanks again for your time @sundareshr. But didn't seen any results now.  just resulted as No results found.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 21:03:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237144#M70483</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2016-11-23T21:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: how can i filter my output to display only the user results which satisfies the condition substraction of the fields **A and B** is greater than 3 hours.  Where A and B are the epoch times converted to human readable time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237145#M70484</link>
      <description>&lt;P&gt;do you get data if you remove the &lt;CODE&gt;where&lt;/CODE&gt; clause? try removing one at a time to see what causes no data&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 21:36:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237145#M70484</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-11-23T21:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: how can i filter my output to display only the user results which satisfies the condition substraction of the fields **A and B** is greater than 3 hours.  Where A and B are the epoch times converted to human readable time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237146#M70485</link>
      <description>&lt;P&gt;After removing the following lines I was able to see the data. But thank you the condition "| where (a_e-y_e)&amp;gt;=1800" worked as expected. &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/140181"&gt;@sundareshr&lt;/a&gt;&lt;/P&gt;

&lt;P&gt;| eval hod=strftime(_time, "%H")&lt;BR /&gt;
 | where hod&amp;gt;=18 AND hod&amp;lt;=6&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:55:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237146#M70485</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2020-09-29T11:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: how can i filter my output to display only the user results which satisfies the condition substraction of the fields **A and B** is greater than 3 hours.  Where A and B are the epoch times converted to human readable time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237147#M70486</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; That should be &lt;CODE&gt;where hod&amp;gt;=18 OR hod&amp;lt;=6&lt;/CODE&gt;. I've update the original as well.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2016 14:05:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-i-filter-my-output-to-display-only-the-user-results/m-p/237147#M70486</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-11-24T14:05:33Z</dc:date>
    </item>
  </channel>
</rss>

