<?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: Importing a CSV and line breaking within a field in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Importing-a-CSV-and-line-breaking-within-a-field/m-p/124161#M25606</link>
    <description>&lt;P&gt;We've done that using a REGEX statement in our transforms.conf.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[csv-transform]
REGEX = (?&amp;lt;fieldA&amp;gt;.*?) | (?&amp;lt;fieldB&amp;gt;.*?) | (?&amp;lt;fieldC&amp;gt;.*?) | (?&amp;lt;fieldD&amp;gt;.*?) | \"(?&amp;lt;description&amp;gt;.*?)\" | (?&amp;lt;fieldF&amp;gt;.*?)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You must also reference this transform in your props.conf.  Ours looks like this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[csv-breaktest]
BREAK_ONLY_BEFORE = (regex unique to our first field)
CHECK_FOR_HEADER = false
KV_MODE = multi
MAX_TIMESTAMP_LOOKAHEAD = 50
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = true
REPORT-csv = csv-transform
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 31 Oct 2013 17:57:01 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2013-10-31T17:57:01Z</dc:date>
    <item>
      <title>Importing a CSV and line breaking within a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Importing-a-CSV-and-line-breaking-within-a-field/m-p/124160#M25605</link>
      <description>&lt;P&gt;Hi Ninjas-&lt;BR /&gt;
I am trying to import a csv that is in the following format, with a header that defines the fields-&lt;/P&gt;

&lt;P&gt;field a | field b | field c | field d | "description field" | field f | field g&lt;/P&gt;

&lt;P&gt;There is no timestamp field, its not required. &lt;/P&gt;

&lt;P&gt;I am able to import the CSV, and event breaking is working fine for the header, and a few of the events.&lt;/P&gt;

&lt;P&gt;However, some of the description fields have multiple line breaks e.g.&lt;/P&gt;

&lt;P&gt;"Description of event blah...&lt;BR /&gt;&lt;BR /&gt;
... blah...&lt;BR /&gt;&lt;BR /&gt;
blah.. &lt;BR /&gt;blah.."&lt;/P&gt;

&lt;P&gt;However they are all contained within the " "'s within the | delimeters.&lt;/P&gt;

&lt;P&gt;I have the following in props.conf (in the import wizard,without spaces after the _ )&lt;BR /&gt;&lt;BR /&gt;
[props]&lt;BR /&gt;&lt;BR /&gt;
sourcetype = csvimport&lt;BR /&gt;&lt;BR /&gt;
SHOULD_ LINEMERGE= true&lt;BR /&gt;&lt;BR /&gt;
CHECK_ FOR_ HEADER = TRUE&lt;BR /&gt;&lt;BR /&gt;
FIELD_ DELIMITER= |&lt;BR /&gt;&lt;BR /&gt;
FIELD_ QUOTE = "&lt;BR /&gt;&lt;BR /&gt;
MUST_BREAK_AFTER = $&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;I have tried using the below two statements to try and bypass the event breaking, perhaps the regex is not working?&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;
MUST_ NOT_ BREAK_ AFTER = |"&lt;BR /&gt;&lt;BR /&gt;
MUST_ NOT_ BREAK_ BEFORE = "|&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;Is there a better way to do this?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:09:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Importing-a-CSV-and-line-breaking-within-a-field/m-p/124160#M25605</guid>
      <dc:creator>diesel6e</dc:creator>
      <dc:date>2020-09-28T15:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a CSV and line breaking within a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Importing-a-CSV-and-line-breaking-within-a-field/m-p/124161#M25606</link>
      <description>&lt;P&gt;We've done that using a REGEX statement in our transforms.conf.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[csv-transform]
REGEX = (?&amp;lt;fieldA&amp;gt;.*?) | (?&amp;lt;fieldB&amp;gt;.*?) | (?&amp;lt;fieldC&amp;gt;.*?) | (?&amp;lt;fieldD&amp;gt;.*?) | \"(?&amp;lt;description&amp;gt;.*?)\" | (?&amp;lt;fieldF&amp;gt;.*?)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You must also reference this transform in your props.conf.  Ours looks like this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[csv-breaktest]
BREAK_ONLY_BEFORE = (regex unique to our first field)
CHECK_FOR_HEADER = false
KV_MODE = multi
MAX_TIMESTAMP_LOOKAHEAD = 50
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = true
REPORT-csv = csv-transform
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Oct 2013 17:57:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Importing-a-CSV-and-line-breaking-within-a-field/m-p/124161#M25606</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2013-10-31T17:57:01Z</dc:date>
    </item>
  </channel>
</rss>

