<?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: Help with evaluating date in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-evaluating-date/m-p/421383#M168490</link>
    <description>&lt;P&gt;Hey Somesoni2!&lt;/P&gt;

&lt;P&gt;Been a bit since I needed your lifeline. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I actually got it working after submitting the question and had to wait until today to add.  Here's what I did that appears to work well:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;"index=snow (NOT "&lt;A href="https://generalatomicsdev.service-now.com/%22" target="_blank"&gt;https://generalatomicsdev.service-now.com/"&lt;/A&gt;) (sourcetype=snow:incident (assignment_group_name="Applications (COTS)" OR assignment_group_name="Account Administration" OR assignment_group_name="SystemsInfra Operations") dv_state!=Resolved&lt;/EM&gt;) OR (sourcetype=snow:sc_task  (dv_assignment_group="Applications (COTS)" OR dv_assignment_group="Account Administration" OR dv_assignment_group="SystemsInfra Operations") dv_state!=Closed*)  |  rename  number AS "Ticket Id", dv_assigned_to AS "Ticket Holder", dv_opened_at AS "Ticket Created", sys_updated_on AS "Last Updated" | where strptime('Ticket Created', "%m/%d/%Y %H:%M:%S %p")&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 20:20:54 GMT</pubDate>
    <dc:creator>gabarrygowin</dc:creator>
    <dc:date>2020-09-29T20:20:54Z</dc:date>
    <item>
      <title>Help with evaluating date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-evaluating-date/m-p/421380#M168487</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;Struggling to get my Service Now times to evaluate just tickets older than 30 days.  The date picker isn't picking them up (suspect because I renamed to a user friendly "Ticket Created" column.  Wanted help to insert an eval command and keep the "Ticket Created" column user friendly.&lt;/P&gt;

&lt;P&gt;Here's my current search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=snow (NOT "https://generalatomicsdev.service-now.com/") (sourcetype=snow:sc_task  dv_assignment_group="SystemsInfra Operations" dv_state!=Closed*) OR (sourcetype=snow:incident assignment_group_name="SystemsInfra Operations" dv_state!=Resolved*) dv_assigned_to!="" | stats dc(number) by number,dv_assigned_to, dv_opened_at, sys_updated_on, sys_updated_by | sort dv_opened_at | fields - dc(number) | rename  number AS "Ticket Id", dv_assigned_to AS "Ticket Holder", dv_opened_at AS "Ticket Created", sys_updated_on AS "Last Updated", sys_updated_by AS "Updated By"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've tried inserting a "search dv_opened_at&amp;gt;=-30d" several ways, but appears Splunk wants a defined date format that I struggle to figure out.  So went with inserting "eval dv_opened_at-relative_time(now(),"-30d")" but that changed the format of the "Ticket Created" column.&lt;/P&gt;

&lt;P&gt;Ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:17:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-evaluating-date/m-p/421380#M168487</guid>
      <dc:creator>gabarrygowin</dc:creator>
      <dc:date>2020-09-29T20:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with evaluating date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-evaluating-date/m-p/421381#M168488</link>
      <description>&lt;P&gt;Hello @gabarrygowin,&lt;/P&gt;

&lt;P&gt;your current search is not all here, right?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 08:20:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-evaluating-date/m-p/421381#M168488</guid>
      <dc:creator>poete</dc:creator>
      <dc:date>2018-07-06T08:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Help with evaluating date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-evaluating-date/m-p/421382#M168489</link>
      <description>&lt;P&gt;If your dv_opened_at field value is in epoch format, try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=snow (NOT "https://generalatomicsdev.service-now.com/") (sourcetype=snow:sc_task  dv_assignment_group="SystemsInfra Operations" dv_state!=Closed*) OR (sourcetype=snow:incident assignment_group_name="SystemsInfra Operations" dv_state!=Resolved*) dv_assigned_to!="" 
| where dv_opened_at&amp;gt;=relative_time(now(),"-30d")
| stats dc(number) by number,dv_assigned_to, dv_opened_at, sys_updated_on, sys_updated_by | sort dv_opened_at | fields - dc(number) | rename  number AS "Ticket Id", dv_assigned_to AS "Ticket Holder", dv_opened_at AS "Ticket Created", sys_updated_on AS "Last Updated", sys_updated_by AS "Updated By"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If it's a timestamp in string format, try like this (assuming the timestamp format is &lt;CODE&gt;%Y-%m-%d %H:%M:%S&lt;/CODE&gt;, update per your date format)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=snow (NOT "https://generalatomicsdev.service-now.com/") (sourcetype=snow:sc_task  dv_assignment_group="SystemsInfra Operations" dv_state!=Closed*) OR (sourcetype=snow:incident assignment_group_name="SystemsInfra Operations" dv_state!=Resolved*) dv_assigned_to!="" 
| where strptime(dv_opened_at,"%Y-%m-%d %H:%M:%S")&amp;gt;=relative_time(now(),"-30d")
| stats dc(number) by number,dv_assigned_to, dv_opened_at, sys_updated_on, sys_updated_by | sort dv_opened_at | fields - dc(number) | rename  number AS "Ticket Id", dv_assigned_to AS "Ticket Holder", dv_opened_at AS "Ticket Created", sys_updated_on AS "Last Updated", sys_updated_by AS "Updated By"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:20:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-evaluating-date/m-p/421382#M168489</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T20:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help with evaluating date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-evaluating-date/m-p/421383#M168490</link>
      <description>&lt;P&gt;Hey Somesoni2!&lt;/P&gt;

&lt;P&gt;Been a bit since I needed your lifeline. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I actually got it working after submitting the question and had to wait until today to add.  Here's what I did that appears to work well:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;"index=snow (NOT "&lt;A href="https://generalatomicsdev.service-now.com/%22" target="_blank"&gt;https://generalatomicsdev.service-now.com/"&lt;/A&gt;) (sourcetype=snow:incident (assignment_group_name="Applications (COTS)" OR assignment_group_name="Account Administration" OR assignment_group_name="SystemsInfra Operations") dv_state!=Resolved&lt;/EM&gt;) OR (sourcetype=snow:sc_task  (dv_assignment_group="Applications (COTS)" OR dv_assignment_group="Account Administration" OR dv_assignment_group="SystemsInfra Operations") dv_state!=Closed*)  |  rename  number AS "Ticket Id", dv_assigned_to AS "Ticket Holder", dv_opened_at AS "Ticket Created", sys_updated_on AS "Last Updated" | where strptime('Ticket Created', "%m/%d/%Y %H:%M:%S %p")&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:20:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-evaluating-date/m-p/421383#M168490</guid>
      <dc:creator>gabarrygowin</dc:creator>
      <dc:date>2020-09-29T20:20:54Z</dc:date>
    </item>
  </channel>
</rss>

