<?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 time field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/convert-time-field/m-p/286621#M190705</link>
    <description>&lt;P&gt;What is your intention / use case? please explain a bit further otherwise no one will be able to help you in the end &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Apr 2016 12:10:35 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2016-04-08T12:10:35Z</dc:date>
    <item>
      <title>convert time field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/convert-time-field/m-p/286618#M190702</link>
      <description>&lt;P&gt;i have the last sync time for my activesync clients going to splunk via powershell input. &lt;BR /&gt;
ex: &lt;CODE&gt;LastSyncAttemptTime = 04/07/2016 21:49:08&lt;/CODE&gt;&lt;BR /&gt;
this produces a text field that is not sortable or useable. &lt;BR /&gt;
i tried to convert it using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval lastSync=strptime(LastSyncAttemptTime,"%x %T") | table lastSync
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;with no luck. i have tired numerous variations of %codes to list the date and time, and a few variations produce a decimal value. &lt;/P&gt;

&lt;P&gt;my end goal here is to look for clients that last synced over 30 days ago.&lt;/P&gt;

&lt;P&gt;any ideas?&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;

&lt;P&gt;Gd&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 02:36:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/convert-time-field/m-p/286618#M190702</guid>
      <dc:creator>gdavid</dc:creator>
      <dc:date>2016-04-08T02:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: convert time field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/convert-time-field/m-p/286619#M190703</link>
      <description>&lt;P&gt;Hi gdavid,&lt;/P&gt;

&lt;P&gt;you can try this instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval lastSync=strptime(LastSyncAttemptTime, "%m/%d/%Y %H:%M:%S")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 03:18:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/convert-time-field/m-p/286619#M190703</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-04-08T03:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: convert time field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/convert-time-field/m-p/286620#M190704</link>
      <description>&lt;P&gt;that yields: &lt;/P&gt;

&lt;P&gt;LastSyncAttemptTime&lt;BR /&gt;
04/08/2016 07:19:46&lt;/P&gt;

&lt;P&gt;lastSync&lt;BR /&gt;
1460114386.000000&lt;/P&gt;

&lt;P&gt;which looks like it converted it into epoch time. convert again? &lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 12:00:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/convert-time-field/m-p/286620#M190704</guid>
      <dc:creator>gdavid</dc:creator>
      <dc:date>2016-04-08T12:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: convert time field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/convert-time-field/m-p/286621#M190705</link>
      <description>&lt;P&gt;What is your intention / use case? please explain a bit further otherwise no one will be able to help you in the end &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 12:10:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/convert-time-field/m-p/286621#M190705</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-04-08T12:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: convert time field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/convert-time-field/m-p/286622#M190706</link>
      <description>&lt;P&gt;this seems to be working to generate the field in human readable format&lt;/P&gt;

&lt;P&gt;lastSync=strftime(strptime(LastSyncAttemptTime, "%m/%d/%Y %H:%M:%S"),"%m/%d/%y %H:%M:%S")&lt;/P&gt;

&lt;P&gt;what i realized is to finish the rest of the search it was easier to leave it in epoch time. use this for now:&lt;/P&gt;

&lt;P&gt;| eval lastSync=strptime(LastSyncAttemptTime, "%m/%d/%Y %H:%M:%S") | eval lastsyncbad = relative_time(now(), "-30d" ) | where lastSync &amp;lt; lastsyncbad&lt;/P&gt;

&lt;P&gt;there might be a more effective method but this works.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 12:20:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/convert-time-field/m-p/286622#M190706</guid>
      <dc:creator>gdavid</dc:creator>
      <dc:date>2016-04-08T12:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: convert time field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/convert-time-field/m-p/286623#M190707</link>
      <description>&lt;P&gt;from above: my end goal here is to look for clients that last synced over 30 days ago.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 12:21:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/convert-time-field/m-p/286623#M190707</guid>
      <dc:creator>gdavid</dc:creator>
      <dc:date>2016-04-08T12:21:22Z</dc:date>
    </item>
  </channel>
</rss>

