<?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 in CSV upload in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Convert-time-in-CSV-upload/m-p/495204#M84479</link>
    <description>&lt;P&gt;For field names in that position/operation, you need to use &lt;CODE&gt;'&lt;/CODE&gt; or &lt;CODE&gt;$&lt;/CODE&gt;, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup YourCsvFileHere.csv
| eval _time= strptime('Scan Date', "%m/%d/%Y %I:%M:%S %p")
| addinfo
| replace "+Infinity" WITH "9999999999" IN info_max_time
| rename info_* AS _info_*
| where _time &amp;gt;= _info_min_time AND _time &amp;lt;= _info_max_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But fields with spaces are EVIL so you could avoid all of that by doing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup YourCsvFileHere.csv
| rename "* *" AS *_*
| eval _time= strptime(Scan_Date, "%m/%d/%Y %I:%M:%S %p")
| addinfo
| replace "+Infinity" WITH "9999999999" IN info_max_time
| rename info_* AS _info_*
| where _time &amp;gt;= _info_min_time AND _time &amp;lt;= _info_max_time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 29 Nov 2019 19:34:50 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-11-29T19:34:50Z</dc:date>
    <item>
      <title>Convert time in CSV upload</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-time-in-CSV-upload/m-p/495203#M84478</link>
      <description>&lt;P&gt;I have a CSV file uploaded via "lookup Editor" and my "Scan Date" column has the following time format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;11/19/2019 11:13:53 AM
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want Splunk to recognize this time format for me to tell it to display everything older than 7 days from now.&lt;BR /&gt;
First step was to change it to epoch to then change to 11/19/2019 format, excluding the hour, minutes and seconds.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval "epoch"= strptime("Scan Date","%m/%d/%Y %I:%M:%S %p")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I don't see anything when I:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;table "epoch" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What am I missing?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 17:30:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-time-in-CSV-upload/m-p/495203#M84478</guid>
      <dc:creator>vulnfree</dc:creator>
      <dc:date>2019-11-29T17:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Convert time in CSV upload</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-time-in-CSV-upload/m-p/495204#M84479</link>
      <description>&lt;P&gt;For field names in that position/operation, you need to use &lt;CODE&gt;'&lt;/CODE&gt; or &lt;CODE&gt;$&lt;/CODE&gt;, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup YourCsvFileHere.csv
| eval _time= strptime('Scan Date', "%m/%d/%Y %I:%M:%S %p")
| addinfo
| replace "+Infinity" WITH "9999999999" IN info_max_time
| rename info_* AS _info_*
| where _time &amp;gt;= _info_min_time AND _time &amp;lt;= _info_max_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But fields with spaces are EVIL so you could avoid all of that by doing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup YourCsvFileHere.csv
| rename "* *" AS *_*
| eval _time= strptime(Scan_Date, "%m/%d/%Y %I:%M:%S %p")
| addinfo
| replace "+Infinity" WITH "9999999999" IN info_max_time
| rename info_* AS _info_*
| where _time &amp;gt;= _info_min_time AND _time &amp;lt;= _info_max_time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Nov 2019 19:34:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-time-in-CSV-upload/m-p/495204#M84479</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-29T19:34:50Z</dc:date>
    </item>
  </channel>
</rss>

