<?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: CSV with custom quoting in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/CSV-with-custom-quoting/m-p/348126#M63917</link>
    <description>&lt;P&gt;So i tried this approach and it did the job in the raw event data however the field still had the braces in &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Mar 2017 10:09:22 GMT</pubDate>
    <dc:creator>anthonysomerset</dc:creator>
    <dc:date>2017-03-08T10:09:22Z</dc:date>
    <item>
      <title>CSV with custom quoting</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/CSV-with-custom-quoting/m-p/348124#M63915</link>
      <description>&lt;P&gt;Hi There&lt;/P&gt;

&lt;P&gt;i have a CSV/UDR without headers with following example rows&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;session_start,0    ,0    ,2017-03-07 20:00:50 +0200     ,                              ,172.99.99.0~86056588,labtest             ,172.99.99.0       ,       [0],         0,         0,         0,         0
usage_start  ,0    ,0    ,2017-03-07 20:25:37 +0200     ,2017-03-07 20:25:47 +0200     ,172.99.99.0~86056588,labtest             ,172.99.99.0       ,   [27770],     20549,     18187,      2362,         0
usage_int    ,0    ,3    ,2017-03-07 20:33:05 +0200     ,2017-03-07 20:41:54 +0200     ,172.99.99.0~86056588,labtest             ,172.99.99.0       ,   [15457],     54450,     36051,     18399,         0
usage_stop   ,0    ,5    ,2017-03-07 20:46:23 +0200     ,2017-03-07 20:46:23 +0200     ,172.99.99.0~86056588,labtest             ,172.99.99.0       ,    [6322],         0,         0,         0,         0
session_stop ,0    ,59   ,2017-03-07 20:00:50 +0200     ,2017-03-07 20:59:32 +0200     ,172.99.99.0~86056588,labtest             ,172.99.99.0       ,       [0],         0,         0,         0,         0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;currently i have a props that looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sde_rg_udr]
SHOULD_LINEMERGE=false
KV_MODE = NONE
TIME_FORMAT = %Y-%m-%d %H:%M:%S %z
TIME_PREFIX=(?:.*?,){3}
MAX_TIMESTAMP_LOOKAHEAD = 26
INDEXED_EXTRACTIONS = CSV
FIELD_NAMES = RecordType,RecordStatus,RecordNumber,StartTime,EndTime,AcctSessionId,SubscriberId,FramedIp,[ServiceId],TotalBytes,RxBytes,TxBytes,Time
TZ = Africa/Harare
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Unfortunately the ServiceID field is encapsulated in [] braces and i just need the id without the braces - how can i change my props to extract the field at index time without the braces?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 06:59:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/CSV-with-custom-quoting/m-p/348124#M63915</guid>
      <dc:creator>anthonysomerset</dc:creator>
      <dc:date>2017-03-08T06:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: CSV with custom quoting</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/CSV-with-custom-quoting/m-p/348125#M63916</link>
      <description>&lt;P&gt;Hi anthonysomerset,&lt;BR /&gt;
try to insert in your props.conf file the following line to change ",[" and "]," with commas:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-drop1 = s/,\[/,/g
SEDCMD-drop2 = s/\],/,/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 08:55:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/CSV-with-custom-quoting/m-p/348125#M63916</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-03-08T08:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: CSV with custom quoting</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/CSV-with-custom-quoting/m-p/348126#M63917</link>
      <description>&lt;P&gt;So i tried this approach and it did the job in the raw event data however the field still had the braces in &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 10:09:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/CSV-with-custom-quoting/m-p/348126#M63917</guid>
      <dc:creator>anthonysomerset</dc:creator>
      <dc:date>2017-03-08T10:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: CSV with custom quoting</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/CSV-with-custom-quoting/m-p/348127#M63918</link>
      <description>&lt;P&gt;So i tried @cusello approach of the SEDCMD but it didn't do what i wanted it to &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;i Ended up down the regex extraction route mainly because of all the additional spaces used for padding - for the benefit of others my final props config was &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sde_rg_udr]
SHOULD_LINEMERGE=false
KV_MODE = NONE
TIME_FORMAT = %Y-%m-%d %H:%M:%S %z
TIME_PREFIX=(?:.*?,){3}
MAX_TIMESTAMP_LOOKAHEAD = 26
EXTRACT-sde_rg_udr = ^(?P&amp;lt;RecordType&amp;gt;[^,]*)\s*,(?P&amp;lt;RecordStatus&amp;gt;[^,]*)\s*,(?P&amp;lt;RecordNumber&amp;gt;[^,]*)\s*,(?P&amp;lt;StartTime&amp;gt;\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\s\+\d{4})\s*,(?P&amp;lt;EndTime&amp;gt;\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\s\+\d{4})\s*,(?P&amp;lt;AcctSessionId&amp;gt;[^,]*)\s*,(?P&amp;lt;SubscriberId&amp;gt;[^,]*)\s*,(?P&amp;lt;FramedIp&amp;gt;[^,]*)\s*,\s*\[(?P&amp;lt;ServiceId&amp;gt;[^,]*)\],\s*(?P&amp;lt;TotalBytes&amp;gt;[^,]*),\s*(?P&amp;lt;RxBytes&amp;gt;[^,]*),\s*(?P&amp;lt;TxBytes&amp;gt;[^,]*),\s*(?P&amp;lt;Time&amp;gt;[^,]*)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Mar 2017 10:11:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/CSV-with-custom-quoting/m-p/348127#M63918</guid>
      <dc:creator>anthonysomerset</dc:creator>
      <dc:date>2017-03-08T10:11:01Z</dc:date>
    </item>
  </channel>
</rss>

