<?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 How to use the &amp;quot;IF&amp;quot; statement to evaluate a window of time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-quot-IF-quot-statement-to-evaluate-a-window-of/m-p/384982#M112426</link>
    <description>&lt;P&gt;I apologize in advance as I'm new to Splunk searching...&lt;/P&gt;

&lt;P&gt;I currently have a basic search for my dashboard that returns newly created user accounts;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog EventCode=4720| table _time Display_Name | sort generated_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I would like to do is enhance this with a new column to show me accounts created outside of normal business hours.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog EventCode=4720| table _time Display_Name | eval _time=if(_time(earliest="*/*/*:08:00:00" latest="*/*/*:17:00:00"), Normal, Abnormal)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm sure I'm completely screwing up this "IF" statement and evaluating the time window doesn't help it, so I'd appreciate any advice anyone has. Thanks!!&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jun 2018 15:13:13 GMT</pubDate>
    <dc:creator>OfficeLackey</dc:creator>
    <dc:date>2018-06-15T15:13:13Z</dc:date>
    <item>
      <title>How to use the "IF" statement to evaluate a window of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-quot-IF-quot-statement-to-evaluate-a-window-of/m-p/384982#M112426</link>
      <description>&lt;P&gt;I apologize in advance as I'm new to Splunk searching...&lt;/P&gt;

&lt;P&gt;I currently have a basic search for my dashboard that returns newly created user accounts;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog EventCode=4720| table _time Display_Name | sort generated_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I would like to do is enhance this with a new column to show me accounts created outside of normal business hours.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog EventCode=4720| table _time Display_Name | eval _time=if(_time(earliest="*/*/*:08:00:00" latest="*/*/*:17:00:00"), Normal, Abnormal)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm sure I'm completely screwing up this "IF" statement and evaluating the time window doesn't help it, so I'd appreciate any advice anyone has. Thanks!!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 15:13:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-quot-IF-quot-statement-to-evaluate-a-window-of/m-p/384982#M112426</guid>
      <dc:creator>OfficeLackey</dc:creator>
      <dc:date>2018-06-15T15:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the "IF" statement to evaluate a window of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-quot-IF-quot-statement-to-evaluate-a-window-of/m-p/384983#M112427</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog EventCode=4720| table _time Display_Name 
| eval CreationTimeRemark=if(_time&amp;gt;=relative_time(_time,"@d+8h") AND _time&amp;lt;relative_time(_time,"@d+17h"), "Normal", "Abnormal")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The _time is a special field which (should) contains epoch value of the timestamp and should be kept that way for it's functionalities. Here the if conditions check if the value of _time (timestamp of event) falls within 8:00 and 17:00 of the same day.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 18:12:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-quot-IF-quot-statement-to-evaluate-a-window-of/m-p/384983#M112427</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-06-15T18:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the "IF" statement to evaluate a window of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-quot-IF-quot-statement-to-evaluate-a-window-of/m-p/384984#M112428</link>
      <description>&lt;P&gt;Awesome! Totally works!! Thanks!!! &lt;/P&gt;

&lt;P&gt;Now I'll spend the next 3 days figuring out how it works... &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 20:29:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-quot-IF-quot-statement-to-evaluate-a-window-of/m-p/384984#M112428</guid>
      <dc:creator>OfficeLackey</dc:creator>
      <dc:date>2018-06-15T20:29:32Z</dc:date>
    </item>
  </channel>
</rss>

