<?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: What character is Splunk using for line breaks in a multiline event? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225625#M66538</link>
    <description>&lt;P&gt;You are correct; as far as I know, linebreaks cannot be preserved. HOWEVER, you can convert your single-value field containing line-breaks to a multi-value field where each value begins/ends at a line break and the order is preserved.&lt;/P&gt;

&lt;P&gt;Do it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex max_match=0 field=multiLineField "(?ms)^\s*(?&amp;lt;multiValueField&amp;gt;[^\r\n]+)\s*$"
| eval multiLineField=multiValueField
| table host multiLineField
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 01 Mar 2016 16:53:38 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2016-03-01T16:53:38Z</dc:date>
    <item>
      <title>What character is Splunk using for line breaks in a multiline event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225621#M66534</link>
      <description>&lt;P&gt;I have inputs configured to allow for multiline events, representing groups of log lines. I'm then using it to build a very simple search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=mlc sourcetype=log4j host=x | table _time message log_level
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to know what happens to the data when it gets displayed in a table - it seems that the line breaks are not preserved, but are converted into &lt;CODE&gt;/s&lt;/CODE&gt;. Is this correct? Is there any way I can preserve the line breaks? Or even just see the literal &lt;CODE&gt;/n&lt;/CODE&gt; character, or whatever it is.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
John Raftery&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 15:20:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225621#M66534</guid>
      <dc:creator>johnraftery</dc:creator>
      <dc:date>2016-03-01T15:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: What character is Splunk using for line breaks in a multiline event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225622#M66535</link>
      <description>&lt;P&gt;Sorry if my question is poorly worded - not easy to explain!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 15:21:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225622#M66535</guid>
      <dc:creator>johnraftery</dc:creator>
      <dc:date>2016-03-01T15:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: What character is Splunk using for line breaks in a multiline event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225623#M66536</link>
      <description>&lt;P&gt;Hi John, the &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.3/SearchReference/Table"&gt;table&lt;/A&gt; command doesn't offer anything in the way of formatting. Although the normal event viewer displays multiline events properly, once piping to table, the table command displays the fields without line breaks. &lt;/P&gt;

&lt;P&gt;Please let me know if this answers your question &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 16:10:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225623#M66536</guid>
      <dc:creator>muebel</dc:creator>
      <dc:date>2016-03-01T16:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: What character is Splunk using for line breaks in a multiline event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225624#M66537</link>
      <description>&lt;P&gt;Thanks. What I'd like to know is if there is a way to retain the line breaks. Is the answer is no (and based on your response it probably is), then will I be able to use "/n" to search my data? EG:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | search message = "First line\nSecond line"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Mar 2016 16:17:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225624#M66537</guid>
      <dc:creator>johnraftery</dc:creator>
      <dc:date>2016-03-01T16:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: What character is Splunk using for line breaks in a multiline event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225625#M66538</link>
      <description>&lt;P&gt;You are correct; as far as I know, linebreaks cannot be preserved. HOWEVER, you can convert your single-value field containing line-breaks to a multi-value field where each value begins/ends at a line break and the order is preserved.&lt;/P&gt;

&lt;P&gt;Do it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex max_match=0 field=multiLineField "(?ms)^\s*(?&amp;lt;multiValueField&amp;gt;[^\r\n]+)\s*$"
| eval multiLineField=multiValueField
| table host multiLineField
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Mar 2016 16:53:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225625#M66538</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-03-01T16:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: What character is Splunk using for line breaks in a multiline event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225626#M66539</link>
      <description>&lt;P&gt;Ah, that's working now. Thanks very much! I'm wondering, when you click on one of the lines in the multiValueField (when it's displayed in a table), is it possible to get just that line in a token? I would normally put something like this in the drilldown, but it captures the whole MV field:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;          &amp;lt;set token="message"&amp;gt;$row.message$&amp;lt;/set&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Mar 2016 10:13:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225626#M66539</guid>
      <dc:creator>johnraftery</dc:creator>
      <dc:date>2016-03-03T10:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: What character is Splunk using for line breaks in a multiline event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225627#M66540</link>
      <description>&lt;P&gt;I'm an engineer, not a magician!  Seriously, though, I suspect it is possible but don't do much custom drill-down.  I would click &lt;CODE&gt;Accept&lt;/CODE&gt; on this answer and then post a new question "How can I drilldown on one value of a multiValue field?"&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 00:12:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225627#M66540</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-03-04T00:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: What character is Splunk using for line breaks in a multiline event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225628#M66541</link>
      <description>&lt;P&gt;Fair enough. Thanks again.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 09:36:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-character-is-Splunk-using-for-line-breaks-in-a-multiline/m-p/225628#M66541</guid>
      <dc:creator>johnraftery</dc:creator>
      <dc:date>2016-03-04T09:36:28Z</dc:date>
    </item>
  </channel>
</rss>

