<?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 add a line break to the eval condition? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-line-break-to-the-eval-condition/m-p/396258#M115038</link>
    <description>&lt;P&gt;Hi @pavanae  ,&lt;/P&gt;

&lt;P&gt;Did you have a chance to check out any answers? If it worked, please resolve this post by approving it! If your problem is still not solved, keep us updated so that someone else can help you. &lt;/P&gt;

&lt;P&gt;Thanks for posting!&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2019 21:54:16 GMT</pubDate>
    <dc:creator>evania</dc:creator>
    <dc:date>2019-06-17T21:54:16Z</dc:date>
    <item>
      <title>How to add a line break to the eval condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-line-break-to-the-eval-condition/m-p/396254#M115034</link>
      <description>&lt;P&gt;I have an eval condition as below in my search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval body= username. " user attempted to delete " . activity_count . " logs by performing the below activities " . mvjoin(activity,", ") . " and removed the logs on host " . src
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which gives the result as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;X user attempted to delete 2 logs by performing the below activities rm /abc/cg.log, rm -rf /def/gc.log and removed the logs on host Y
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now, how can I add a line break as shown below: &lt;/P&gt;

&lt;P&gt;body&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;X user attempted to delete 2 logs by performing the below activities 
rm /abc/cg.log
rm -rf /def/gc.log
and removed the logs on host Y
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please let me know how to modify my eval condition to get the required result as shown above.&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 18:19:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-line-break-to-the-eval-condition/m-p/396254#M115034</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2019-05-31T18:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a line break to the eval condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-line-break-to-the-eval-condition/m-p/396255#M115035</link>
      <description>&lt;P&gt;Simple way to convert the text string to multiple lines is with makemv. &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;|   eval body= username. " user attempted to delete " . activity_count . " logs by performing the below activities :" . mvjoin(activity,": ") . ": and removed the logs on host " . src &lt;BR /&gt;
| makemv delim=":" body&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 31 May 2019 22:26:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-line-break-to-the-eval-condition/m-p/396255#M115035</guid>
      <dc:creator>aromanauskas</dc:creator>
      <dc:date>2019-05-31T22:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a line break to the eval condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-line-break-to-the-eval-condition/m-p/396256#M115036</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You can either go this way mentioned here: &lt;A href="https://answers.splunk.com/answers/40033/add-line-breaks-with-eval.html"&gt;https://answers.splunk.com/answers/40033/add-line-breaks-with-eval.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Or you can simply press shift+enter in the search bar to break line in the string for ex.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1 
| eval test="hello
world"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jun 2019 07:19:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-line-break-to-the-eval-condition/m-p/396256#M115036</guid>
      <dc:creator>harshpatel</dc:creator>
      <dc:date>2019-06-01T07:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a line break to the eval condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-line-break-to-the-eval-condition/m-p/396257#M115037</link>
      <description>&lt;P&gt;This is how I did it&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Description = 
 "Type: " . sys_type 
. "---System Name: " . sys_name
. "---Name: " . name
. "---Filename Pattern: " . filename_pattern
| rex mode=sed field=Description "s/---/\n/g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Basically provide some pattern ("---" in my case) that you want to break the lines on and then replace it with "\n" using sed&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 01:18:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-line-break-to-the-eval-condition/m-p/396257#M115037</guid>
      <dc:creator>ilyaresh</dc:creator>
      <dc:date>2019-06-03T01:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a line break to the eval condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-line-break-to-the-eval-condition/m-p/396258#M115038</link>
      <description>&lt;P&gt;Hi @pavanae  ,&lt;/P&gt;

&lt;P&gt;Did you have a chance to check out any answers? If it worked, please resolve this post by approving it! If your problem is still not solved, keep us updated so that someone else can help you. &lt;/P&gt;

&lt;P&gt;Thanks for posting!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 21:54:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-line-break-to-the-eval-condition/m-p/396258#M115038</guid>
      <dc:creator>evania</dc:creator>
      <dc:date>2019-06-17T21:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a line break to the eval condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-line-break-to-the-eval-condition/m-p/669532#M229619</link>
      <description>&lt;P&gt;that's exactly what I was after!&lt;/P&gt;&lt;P&gt;thanks mate&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 06:15:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-line-break-to-the-eval-condition/m-p/669532#M229619</guid>
      <dc:creator>PZ</dc:creator>
      <dc:date>2023-11-23T06:15:30Z</dc:date>
    </item>
  </channel>
</rss>

