<?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: Convert string to date in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189069#M54483</link>
    <description>&lt;P&gt;Thanks @Lowell.It worked in my case..&lt;/P&gt;</description>
    <pubDate>Wed, 27 May 2015 09:22:27 GMT</pubDate>
    <dc:creator>vgdhavale10</dc:creator>
    <dc:date>2015-05-27T09:22:27Z</dc:date>
    <item>
      <title>Convert string to date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189062#M54476</link>
      <description>&lt;P&gt;Hi, I am tring to convert string data to date and find diff second&lt;BR /&gt;
the problem is that i cant convert the string to date&lt;/P&gt;

&lt;P&gt;...&lt;BR /&gt;
|table Key  DateTime1 DateTime2&lt;/P&gt;

&lt;P&gt;Datetime1&amp;amp;2 formats are [2013-12-17 09:38:57.7667] and they are strings&lt;/P&gt;

&lt;P&gt;i want to find the diff seconds between them&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2013 11:43:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189062#M54476</guid>
      <dc:creator>shayhk</dc:creator>
      <dc:date>2013-12-24T11:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189063#M54477</link>
      <description>&lt;P&gt;I tried&lt;/P&gt;

&lt;P&gt;host=...&lt;BR /&gt;
| table DateTime1&lt;/P&gt;

&lt;P&gt;| convert timeformat="%Y-%m-%d %T" mktime(DateTime1) as _time&lt;/P&gt;

&lt;P&gt;but the _time column is empty&lt;/P&gt;

&lt;P&gt;the DateTime value is [2013-12-17 09:38:57.7667]&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2013 14:59:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189063#M54477</guid>
      <dc:creator>shayhk</dc:creator>
      <dc:date>2013-12-24T14:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189064#M54478</link>
      <description>&lt;P&gt;Can you provide a raw example of the event?  Are you intending to handle the "57" in the above string as the seconds?  Or "57.7667"?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2013 19:21:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189064#M54478</guid>
      <dc:creator>jsie_splunk</dc:creator>
      <dc:date>2013-12-24T19:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189065#M54479</link>
      <description>&lt;P&gt;Is the [ and ] part of the actual value, or are you adding that in to the question? If it's part of the value, timeformat probably needs to know.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2013 09:41:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189065#M54479</guid>
      <dc:creator>sciurus</dc:creator>
      <dc:date>2013-12-26T09:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189066#M54480</link>
      <description>&lt;P&gt;Have you tried ...|eval DateTime1=strptime(DateTime1,"%Y-%m-%d %H:%M:%S.%3Q")?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2013 12:46:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189066#M54480</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-12-26T12:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189067#M54481</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt;
  | rex " (?&amp;lt;dt1&amp;gt;[0-9-]+ [0-9:.]+) (?&amp;lt;dt2&amp;gt;[0-9-]+ [0-9:.]+)"
  | eval dt1=strptime(dt1,"%Y-%m-%d %H:%M:%S.%3Q")
  | eval dt2=strptime(dt2,"%Y-%m-%d %H:%M:%S.%3Q")
  | eval diff=dt2-dt1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Dec 2013 21:58:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189067#M54481</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2013-12-26T21:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189068#M54482</link>
      <description>&lt;P&gt;More info:&lt;BR /&gt;
Eval Functions&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.1/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.1/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;BR /&gt;
Time Formats&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.1/SearchReference/Commontimeformatvariables"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.1/SearchReference/Commontimeformatvariables&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 11:53:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189068#M54482</guid>
      <dc:creator>matthewcanty</dc:creator>
      <dc:date>2014-01-08T11:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Convert string to date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189069#M54483</link>
      <description>&lt;P&gt;Thanks @Lowell.It worked in my case..&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2015 09:22:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-string-to-date/m-p/189069#M54483</guid>
      <dc:creator>vgdhavale10</dc:creator>
      <dc:date>2015-05-27T09:22:27Z</dc:date>
    </item>
  </channel>
</rss>

