<?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: Need help getting right timestamp from CSV in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255495#M76502</link>
    <description>&lt;P&gt;My data is coming from a Universal Forwarder.  Would that make a difference?  The forwarder's inputs.conf stanza is&lt;/P&gt;

&lt;P&gt;[monitor://C:\ProgramData\Symantec.CSM\Logs]&lt;BR /&gt;
    disabled = false&lt;BR /&gt;
    index = ccs&lt;BR /&gt;
    sourcetype = CCScsv&lt;/P&gt;</description>
    <pubDate>Mon, 16 May 2016 22:05:39 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2016-05-16T22:05:39Z</dc:date>
    <item>
      <title>Need help getting right timestamp from CSV</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255491#M76498</link>
      <description>&lt;P&gt;I have a CSV file I'm trying to index, but the wrong timestamp field is getting selected.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;UTC,LOCAL,HOSTNAME,SEVERITY,CATEGORY,PNAME,PID,MTNAME,MTID,METHOD,SRCFILE,SRCLINE,INDENT,MESSAGE
2016-05-10 12:40:00.887,2016-05-10 07:40:00.887,SYMCCS,Error,Data Reader,SymConsole,8316,,1,HandleException,,0,2,"ListBaselineNamed() Exception occured on the server side: 742|System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files (x86)\Symantec\CCS\Reporting and Analytics\Application Server\Console_Sync'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption)
   at Symantec.CCS.DataReaderServer.FileSync.GetAllSCUDllList()
   at Symantec.CCS.DataReaderServer.Server.GetSCUFileList(DispatchObject input)|36|System.IO.DirectoryNotFoundException"
2016-05-10 12:40:00.890,2016-05-10 07:40:00.890,SYMCCS,Error,PreLaunchActivityProvider,SymConsole,8316,,1,DownloadBinaries,,0,1,"System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files (x86)\Symantec\CCS\Reporting and Analytics\Application Server\Console_Sync'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption)
   at Symantec.CCS.DataReaderServer.FileSync.GetAllSCUDllList()
   at Symantec.CCS.DataReaderServer.Server.GetSCUFileList(DispatchObject input)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using the default settings parses the file well except the UTC column is used for _time, meaning times are 5 hours ahead of the system clock.  I can't change the log format so I've been experimenting with other settings to get the right time.&lt;/P&gt;

&lt;P&gt;I've tried:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;CHECK_FOR_HEADER = true
TIMESTAMP_FIELDS = LOCAL
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which correctly sets _time to the LOCAL field, but the remaining fields are not extracted.&lt;/P&gt;

&lt;P&gt;I also tried &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_PREFIX = ,
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which yields the same results.&lt;/P&gt;

&lt;P&gt;Any suggestions for settings that will extract all fields and set _time to LOCAL?&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 20:54:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255491#M76498</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-05-16T20:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need help getting right timestamp from CSV</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255492#M76499</link>
      <description>&lt;P&gt;Have you considered setting the&lt;CODE&gt;TZ&lt;/CODE&gt; to &lt;CODE&gt;UTC&lt;/CODE&gt; and extracting the &lt;CODE&gt;UTC&lt;/CODE&gt; field for &lt;CODE&gt;_time&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 21:10:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255492#M76499</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-05-16T21:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need help getting right timestamp from CSV</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255493#M76500</link>
      <description>&lt;P&gt;That also gets me halfway there.  Times display correctly, but fields are not extracted.&lt;/P&gt;

&lt;P&gt;Here is my props.conf stanza:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[CCScsv]
DATETIME_CONFIG =
INDEXED_EXTRACTIONS = csv
#CHECK_FOR_HEADER = true
KV_MODE = none
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
TZ = UTC
#TIMESTAMP_FIELDS = LOCAL
category = Structured
description = Comma-separated value format. Set header and other settings in "Delimited Settings"
disabled = false
pulldown_type = true
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 May 2016 21:22:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255493#M76500</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-05-16T21:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need help getting right timestamp from CSV</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255494#M76501</link>
      <description>&lt;P&gt;Here's what i did. Copied the data from your post. Created a .csv (verified). Imported the data with &lt;CODE&gt;TZ=UTC&lt;/CODE&gt; and everything looked right. Extracted all the cols, took time from UTC col and I got two events. Here's the &lt;CODE&gt;props&lt;/CODE&gt; from my test&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ csv ]
SHOULD_LINEMERGE=false
NO_BINARY_CHECK=true
CHARSET=UTF-8
INDEXED_EXTRACTIONS=csv
KV_MODE=none
category=Structured
description=Comma-separated value format. Set header and other settings in "Delimited Settings"
disabled=false
pulldown_type=true
TZ=UTC
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then I tried this for &lt;CODE&gt;props&lt;/CODE&gt; and this worked too. Extracted all the cols, took time from LOCAL col and I got two events.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ csv ]
SHOULD_LINEMERGE=false
NO_BINARY_CHECK=true
CHARSET=UTF-8
INDEXED_EXTRACTIONS=csv
KV_MODE=none
category=Structured
description=Comma-separated value format. Set header and other settings in "Delimited Settings"
disabled=false
pulldown_type=true
TIME_FORMAT=%Y-%m-%d %H:%M:%S
TIMESTAMP_FIELDS=LOCAL
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 May 2016 21:49:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255494#M76501</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-05-16T21:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need help getting right timestamp from CSV</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255495#M76502</link>
      <description>&lt;P&gt;My data is coming from a Universal Forwarder.  Would that make a difference?  The forwarder's inputs.conf stanza is&lt;/P&gt;

&lt;P&gt;[monitor://C:\ProgramData\Symantec.CSM\Logs]&lt;BR /&gt;
    disabled = false&lt;BR /&gt;
    index = ccs&lt;BR /&gt;
    sourcetype = CCScsv&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 22:05:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255495#M76502</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-05-16T22:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Need help getting right timestamp from CSV</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255496#M76503</link>
      <description>&lt;P&gt;Wonder if the sourcetypy is throwing a loop. Can you try changing it to csv?&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2016 20:29:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255496#M76503</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-05-17T20:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need help getting right timestamp from CSV</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255497#M76504</link>
      <description>&lt;P&gt;Changing the sourcetype to csv puts me back where I started - fields are extracted, but times are 5 hours in the future.  I don't want to props for all CSVs as they don't all have this problem.&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2016 20:46:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255497#M76504</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-05-17T20:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need help getting right timestamp from CSV</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255498#M76505</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[CCScsv]
INDEXED_EXTRACTIONS = csv
CHECK_FOR_HEADER = true
KV_MODE = none
SHOULD_LINEMERGE = false
TIME_PREFIX=^\d+-\d+-\d+\s+\d+:\d+:\d+\.\d+,
TIME_FORMAT=%Y-%m-%d %H:%M:%S
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 May 2016 21:26:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255498#M76505</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-05-17T21:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need help getting right timestamp from CSV</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255499#M76506</link>
      <description>&lt;P&gt;Thanks for the suggestion, somesoni2.  That fixes the time, but no fields are extracted.&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2016 21:43:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255499#M76506</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-05-17T21:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Need help getting right timestamp from CSV</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255500#M76507</link>
      <description>&lt;P&gt;I ended up putting a manual regex string into the field extractor.  This is what my props.conf looks like on the SH.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[CCScsv]
EXTRACT-CCSlog = (?&amp;lt;UTC&amp;gt;[^,]+),(?&amp;lt;LOCAL&amp;gt;[^,]+),(?&amp;lt;HOSTNAME&amp;gt;[^,]+),(?&amp;lt;SEVERITY&amp;gt;[^,]+),(?&amp;lt;CATEGORY&amp;gt;[^,]+),(?&amp;lt;PNAME&amp;gt;[^,]+),(?&amp;lt;PID&amp;gt;[^,]+),(?&amp;lt;MTNAME&amp;gt;[^,]*),(?&amp;lt;MTID&amp;gt;[^,]+),(?&amp;lt;METHOD&amp;gt;[^,]+),(?&amp;lt;SRCFILE&amp;gt;[^,]*),(?&amp;lt;SRCLINE&amp;gt;[^,]+),(?&amp;lt;INDEX&amp;gt;[^,]+),"(?&amp;lt;MESSAGE&amp;gt;[^"]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 May 2016 16:09:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-getting-right-timestamp-from-CSV/m-p/255500#M76507</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-05-20T16:09:39Z</dc:date>
    </item>
  </channel>
</rss>

