<?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 combine start_hour field and end_hour field and then calculate the average and standard deviation as mentioned below? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-start-hour-field-and-end-hour-field-and-then/m-p/223877#M65938</link>
    <description>&lt;P&gt;First off you would need to convert starthour_and_endhour_yesterday and average(starthour_and_endhour)_for_last_7_days to numeric field (either in hour or minutes)&lt;/P&gt;

&lt;P&gt;For example 00-18 to be replaced with 18 (hrs), or something meaningful as per your use case. Then you can use &lt;STRONG&gt;stdev&lt;/STRONG&gt; stats function on average numeric field multiplied by 3.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 11:43:27 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2020-09-29T11:43:27Z</dc:date>
    <item>
      <title>How to combine start_hour field and end_hour field and then calculate the average and standard deviation as mentioned below?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-start-hour-field-and-end-hour-field-and-then/m-p/223876#M65937</link>
      <description>&lt;P&gt;I have my splunk search as below&lt;/P&gt;

&lt;P&gt;My Search | where date_hour&amp;gt;=16 OR date_hour&amp;lt;9| convert ctime(_time) as Date_and_Time |eval StartHour=strftime(_time,"%H")|eval EndHour=strftime(_time,"%H")  |stats earliest(StartHour) as StartHour latest(EndHour) as EndHour by student_id &lt;/P&gt;

&lt;P&gt;which displays the result as below&lt;/P&gt;

&lt;P&gt;student_id                  StartHour                             EndHour&lt;BR /&gt;
X1234                                     00                                            19&lt;BR /&gt;
Y6789                                       00                                              20&lt;BR /&gt;
V5678                                       02                                            20&lt;BR /&gt;
G4567                                     06                                            06&lt;/P&gt;

&lt;P&gt;Now I'm trying to acheive something like below&lt;/P&gt;

&lt;P&gt;student_id     StartHour     EndHour       starthour_and_endhour_yesterday      average(starthour_and_endhour)_for_last_7_days                     standard_deviation&lt;BR /&gt;
X1234                     00                19                         00-18                                                00-03&lt;BR /&gt;
Y6789               00                20                          01-19                                                02-19&lt;BR /&gt;
V5678                     02                20                           02-19                                               03-19&lt;BR /&gt;
G4567                    06                 06                           06-06                                                06-06&lt;/P&gt;

&lt;P&gt;Where standard_deviation is if student_id accessing starthour_and_endhour is 3 times standard deviation of average&lt;/P&gt;

&lt;P&gt;Now how can i calculate all the fields as mentioned above. Is it possible to acheive by splunk to find the suspecious behaviour of a student_id as mentioned on the above format?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:47:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-start-hour-field-and-end-hour-field-and-then/m-p/223876#M65937</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2020-09-29T11:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine start_hour field and end_hour field and then calculate the average and standard deviation as mentioned below?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-start-hour-field-and-end-hour-field-and-then/m-p/223877#M65938</link>
      <description>&lt;P&gt;First off you would need to convert starthour_and_endhour_yesterday and average(starthour_and_endhour)_for_last_7_days to numeric field (either in hour or minutes)&lt;/P&gt;

&lt;P&gt;For example 00-18 to be replaced with 18 (hrs), or something meaningful as per your use case. Then you can use &lt;STRONG&gt;stdev&lt;/STRONG&gt; stats function on average numeric field multiplied by 3.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:43:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-start-hour-field-and-end-hour-field-and-then/m-p/223877#M65938</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-29T11:43:27Z</dc:date>
    </item>
  </channel>
</rss>

