<?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: Replace a character with a linebreak in table results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/533150#M150635</link>
    <description>&lt;P&gt;The links to the 'other' questions/answers do not work anymore.&lt;BR /&gt;&lt;BR /&gt;But what does work is:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval n=replace(my__field, "___", "
")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;So literally add a newline to your code.&lt;/P&gt;&lt;P&gt;It is silly to need to do it in this way. Why are \n and similar characters as replacements not supported, while they are supported in the pattern. The replace function should also allow other options like replace only one occurrence or all occurrences (learn a bit from the Perl language I guess...)&lt;/P&gt;</description>
    <pubDate>Tue, 15 Dec 2020 13:58:49 GMT</pubDate>
    <dc:creator>mmol</dc:creator>
    <dc:date>2020-12-15T13:58:49Z</dc:date>
    <item>
      <title>Replace a character with a linebreak in table results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/18825#M2781</link>
      <description>&lt;P&gt;I would like to replace all characters "___" in a certain field with a linebreak in my Table module.&lt;/P&gt;

&lt;P&gt;I am currently using the following code&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval n=replace(my_field, "___", "\n")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It does not treat &lt;CODE&gt;\n&lt;/CODE&gt; as a newline. How do I let Splunk know I want a linebreak&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2013 18:12:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/18825#M2781</guid>
      <dc:creator>cmak</dc:creator>
      <dc:date>2013-02-04T18:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Replace a character with a linebreak in table results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/18826#M2782</link>
      <description>&lt;P&gt;Indent code blocks with 4 spaces on each line (or click the "1010101" button which does this for you). This will make code show up properly on the site. I fixed this for you this time though.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2013 19:18:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/18826#M2782</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-02-04T19:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Replace a character with a linebreak in table results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/18827#M2783</link>
      <description>&lt;P&gt;See answers to the following questions:&lt;BR /&gt;
&lt;A href="http://splunk-base.splunk.com/answers/40033/add-line-breaks-with-eval"&gt;http://splunk-base.splunk.com/answers/40033/add-line-breaks-with-eval&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://splunk-base.splunk.com/answers/41691/add-newline-into-table-cell"&gt;http://splunk-base.splunk.com/answers/41691/add-newline-into-table-cell&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2013 19:20:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/18827#M2783</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-02-04T19:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Replace a character with a linebreak in table results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/18828#M2784</link>
      <description>&lt;P&gt;Thanks, just as a note, the mvjoin requires the eval statement in front of it.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2013 19:39:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/18828#M2784</guid>
      <dc:creator>cmak</dc:creator>
      <dc:date>2013-02-04T19:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Replace a character with a linebreak in table results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/18829#M2785</link>
      <description>&lt;P&gt;Thanks, nice catch. Fixed.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2013 19:41:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/18829#M2785</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-02-04T19:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Replace a character with a linebreak in table results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/18830#M2786</link>
      <description>&lt;P&gt;The second answer here &lt;A href="http://splunk-base.splunk.com/answers/41691/add-newline-into-table-cell"&gt;http://splunk-base.splunk.com/answers/41691/add-newline-into-table-cell&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Which says use split. That worked for me. Rex mode=sed doesn't work for me.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 01:09:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/18830#M2786</guid>
      <dc:creator>ZacEsa</dc:creator>
      <dc:date>2016-08-17T01:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Replace a character with a linebreak in table results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/18831#M2787</link>
      <description>&lt;P&gt;If this helps anyone, I solved this using a streamstats which always resets:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...
| streamstats reset_before="1=1" list(mvfield) as mvfield
| table mvfield
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Oct 2017 20:06:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/18831#M2787</guid>
      <dc:creator>afreidin</dc:creator>
      <dc:date>2017-10-02T20:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Replace a character with a linebreak in table results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/533150#M150635</link>
      <description>&lt;P&gt;The links to the 'other' questions/answers do not work anymore.&lt;BR /&gt;&lt;BR /&gt;But what does work is:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval n=replace(my__field, "___", "
")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;So literally add a newline to your code.&lt;/P&gt;&lt;P&gt;It is silly to need to do it in this way. Why are \n and similar characters as replacements not supported, while they are supported in the pattern. The replace function should also allow other options like replace only one occurrence or all occurrences (learn a bit from the Perl language I guess...)&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 13:58:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-a-character-with-a-linebreak-in-table-results/m-p/533150#M150635</guid>
      <dc:creator>mmol</dc:creator>
      <dc:date>2020-12-15T13:58:49Z</dc:date>
    </item>
  </channel>
</rss>

