<?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: Conversion from string to date in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Conversion-from-string-to-date/m-p/177761#M51093</link>
    <description>&lt;P&gt;It didn't worked. is it because i am not converting the date properly in expiryDate??&lt;/P&gt;</description>
    <pubDate>Mon, 30 Dec 2013 07:00:33 GMT</pubDate>
    <dc:creator>c_sahil</dc:creator>
    <dc:date>2013-12-30T07:00:33Z</dc:date>
    <item>
      <title>Conversion from string to date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conversion-from-string-to-date/m-p/177759#M51091</link>
      <description>&lt;P&gt;I am having a field deliveryExpiry (String type) in my log and I want to compare whether the expiry is before the current date or after.Below I am giving the sample log&lt;/P&gt;

&lt;P&gt;deliveryExpiry=Wed Dec 25 18:30:00 GMT 2013 deliveryNumber=110 MESSAGE=delivered&lt;/P&gt;

&lt;P&gt;i tried something like this &lt;/P&gt;

&lt;P&gt;| eval expiryDate=strptime(deliveryExpiry,"%a %b %d %H:%M:%S %Z %Y") | eval current=now() |  where expiryDate&amp;gt;strptime(current,"%a %b %d %H %M %S %Z %Y")&lt;/P&gt;

&lt;P&gt;but No luck.can anyone please help&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2013 09:14:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conversion-from-string-to-date/m-p/177759#M51091</guid>
      <dc:creator>c_sahil</dc:creator>
      <dc:date>2013-12-13T09:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from string to date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conversion-from-string-to-date/m-p/177760#M51092</link>
      <description>&lt;P&gt;The &lt;CODE&gt;now()&lt;/CODE&gt; function returns an integer so there's no need to &lt;CODE&gt;strptime()&lt;/CODE&gt; it.  Using &lt;CODE&gt;'where expiryDate&amp;gt;current'&lt;/CODE&gt; should do the trick.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2013 14:48:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conversion-from-string-to-date/m-p/177760#M51092</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2013-12-13T14:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from string to date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conversion-from-string-to-date/m-p/177761#M51093</link>
      <description>&lt;P&gt;It didn't worked. is it because i am not converting the date properly in expiryDate??&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2013 07:00:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conversion-from-string-to-date/m-p/177761#M51093</guid>
      <dc:creator>c_sahil</dc:creator>
      <dc:date>2013-12-30T07:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from string to date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conversion-from-string-to-date/m-p/177762#M51094</link>
      <description>&lt;P&gt;when i tried the below query then also it didn't work..&lt;/P&gt;

&lt;P&gt;| eval expiryDate=strptime(deliveryExpiry,"%a %b %d %H:%M:%S %Z %Y") | eval date=strptime(deliveryExpiry,"%a %b %d %H:%M:%S %Z %Y") | where expiryDate=date&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2013 07:09:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conversion-from-string-to-date/m-p/177762#M51094</guid>
      <dc:creator>c_sahil</dc:creator>
      <dc:date>2013-12-30T07:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from string to date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conversion-from-string-to-date/m-p/177763#M51095</link>
      <description>&lt;P&gt;Have you tried replacing &lt;CODE&gt;'where expiryDate=date'&lt;/CODE&gt; with &lt;CODE&gt;'table expiryDate,date'&lt;/CODE&gt; to see why they don't match?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2013 17:33:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conversion-from-string-to-date/m-p/177763#M51095</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2013-12-30T17:33:06Z</dc:date>
    </item>
  </channel>
</rss>

