<?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: How to replace line breaks with delimiters? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-line-breaks-with-delimiters/m-p/268876#M51617</link>
    <description>&lt;P&gt;try something like this, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search.... | eval o1=o  |nomv o1 | rex mode=sed field=o1 "s/\n/|/g" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 02 Feb 2017 22:19:30 GMT</pubDate>
    <dc:creator>vasanthmss</dc:creator>
    <dc:date>2017-02-02T22:19:30Z</dc:date>
    <item>
      <title>How to replace line breaks with delimiters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-line-breaks-with-delimiters/m-p/268872#M51613</link>
      <description>&lt;P&gt;I'm trying to replicate other threads that show how to replace line breaks with delimiters. This search is not working. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| ldapsearch domain=ED search="(&amp;amp;(objectClass=eduPerson)(weillCornellEduCWID=paa2013))" attrs="weillCornellEduCWID,o" 
| eval o1 = replace (o, "[\\n\\r]+","|")
| eval o2 = replace (o, "[\n\r]","|")
| table weillCornellEduCWID, o, o1, o2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any ideas? See screenshot below.. &lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2409i3B61CE772321D7F5/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 21:17:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-line-breaks-with-delimiters/m-p/268872#M51613</guid>
      <dc:creator>paulalbert11</dc:creator>
      <dc:date>2017-02-02T21:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace line breaks with delimiters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-line-breaks-with-delimiters/m-p/268873#M51614</link>
      <description>&lt;P&gt;Does this work?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| ldapsearch domain=ED search="(&amp;amp;(objectClass=eduPerson)(weillCornellEduCWID=paa2013))" attrs="weillCornellEduCWID,o" 
 | eval o1 = replace (o, "[\r\n]+","|")
 | eval o2 = replace (o, "\n","|")
 | table weillCornellEduCWID, o, o1, o2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Feb 2017 21:26:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-line-breaks-with-delimiters/m-p/268873#M51614</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-02T21:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace line breaks with delimiters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-line-breaks-with-delimiters/m-p/268874#M51615</link>
      <description>&lt;P&gt;Thanks for your response, somesoni2. Unfortunately, no. When I run the query, I just get blanks in the o1 and o2 fields.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 21:59:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-line-breaks-with-delimiters/m-p/268874#M51615</guid>
      <dc:creator>paulalbert11</dc:creator>
      <dc:date>2017-02-02T21:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace line breaks with delimiters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-line-breaks-with-delimiters/m-p/268875#M51616</link>
      <description>&lt;P&gt;So, if I'm not wrong, the field o is a multivalued field and you just want to make it linear with delimiter as pipe. Is that correct?&lt;BR /&gt;
If that is correct, what do you get when you run this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| ldapsearch domain=ED search="(&amp;amp;(objectClass=eduPerson)(weillCornellEduCWID=paa2013))" attrs="weillCornellEduCWID,o" 
  | eval o1 =o | nomv o1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| ldapsearch domain=ED search="(&amp;amp;(objectClass=eduPerson)(weillCornellEduCWID=paa2013))" attrs="weillCornellEduCWID,o" 
| eventstats values(o) as o1 delim="|" | nomv o1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Feb 2017 22:14:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-line-breaks-with-delimiters/m-p/268875#M51616</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-02T22:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace line breaks with delimiters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-line-breaks-with-delimiters/m-p/268876#M51617</link>
      <description>&lt;P&gt;try something like this, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search.... | eval o1=o  |nomv o1 | rex mode=sed field=o1 "s/\n/|/g" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Feb 2017 22:19:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-line-breaks-with-delimiters/m-p/268876#M51617</guid>
      <dc:creator>vasanthmss</dc:creator>
      <dc:date>2017-02-02T22:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace line breaks with delimiters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-line-breaks-with-delimiters/m-p/268877#M51618</link>
      <description>&lt;P&gt;It works like a charm. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 23:03:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-line-breaks-with-delimiters/m-p/268877#M51618</guid>
      <dc:creator>paulalbert11</dc:creator>
      <dc:date>2017-02-02T23:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace line breaks with delimiters?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-line-breaks-with-delimiters/m-p/268878#M51619</link>
      <description>&lt;P&gt;does exactly what I needed, and much simpler&lt;BR /&gt;
 than the replace function I was trying to get to work.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 13:55:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-line-breaks-with-delimiters/m-p/268878#M51619</guid>
      <dc:creator>plimpach</dc:creator>
      <dc:date>2019-06-05T13:55:55Z</dc:date>
    </item>
  </channel>
</rss>

