<?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: Syntax to break a line in search so that it breaks into two lines in servicenow in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Syntax-to-break-a-line-in-search-so-that-it-breaks-into-two/m-p/676994#M231504</link>
    <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command can either extract fields from an event or replace text in an event.&amp;nbsp; In this case, &lt;FONT face="courier new,courier"&gt;mode=sed&lt;/FONT&gt; tells it to replace text.&amp;nbsp; The &lt;FONT face="courier new,courier"&gt;field=summary&lt;/FONT&gt; option restricts the command to the contents of the summary field.&lt;/P&gt;&lt;P&gt;The quoted string is the sed command to execute.&amp;nbsp; The 's' represents the substitute command.&amp;nbsp; The part after the first slash is a regular expression.&amp;nbsp; It says to look for the string "&lt;FONT face="courier new,courier"&gt;from '&lt;/FONT&gt;" followed by any number of additional characters (.*).&amp;nbsp; The parentheses create a group we'll refer back to later.&amp;nbsp; The part after the next slash is the replacement text.&amp;nbsp; It puts the "from" back, adds a newline character (\n), then adds the remainder of the original text (the group from part 1).&lt;/P&gt;&lt;P&gt;To read more about rex, see the Search Reference manual.&amp;nbsp; &lt;A href="https://docs.splunk.com/Documentation/Splunk/9.2.0/SearchReference/Rex" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/9.2.0/SearchReference/Rex&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Feb 2024 18:40:18 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2024-02-08T18:40:18Z</dc:date>
    <item>
      <title>Syntax to break a line in search so that it breaks into two lines in servicenow</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Syntax-to-break-a-line-in-search-so-that-it-breaks-into-two/m-p/676747#M231433</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have a field called summary in my search -&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Failed backup of the transaction log for SQL Server database 'model' from 'WSQL040Q.tkmaxx.tjxcorp.net\\MSSQLSERVER'.&lt;/LI-CODE&gt;&lt;P&gt;I am creating this search for service-now alert and I am sending this summary field value under comments in ServiceNow.&lt;/P&gt;&lt;P&gt;I need it to break in two lines like this -&lt;/P&gt;&lt;P&gt;Line1-Failed backup of the transaction log for SQL Server database 'model' from&lt;BR /&gt;Line2-'WSQL040Q.tkmaxx.tjxcorp.net\\MSSQLSERVER'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I implement this in my Search?&lt;/P&gt;&lt;P&gt;Thanks In Advance!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 14:19:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Syntax-to-break-a-line-in-search-so-that-it-breaks-into-two/m-p/676747#M231433</guid>
      <dc:creator>man03359</dc:creator>
      <dc:date>2024-02-06T14:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax to break a line in search so that it breaks into two lines in servicenow</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Syntax-to-break-a-line-in-search-so-that-it-breaks-into-two/m-p/676752#M231435</link>
      <description>&lt;P&gt;If SNOW will interpret a newline character as dividing the field into two lines then this may work.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=summary mode=sed "s/from '(.*)/from\n'\1/"&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 06 Feb 2024 15:27:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Syntax-to-break-a-line-in-search-so-that-it-breaks-into-two/m-p/676752#M231435</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-02-06T15:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax to break a line in search so that it breaks into two lines in servicenow</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Syntax-to-break-a-line-in-search-so-that-it-breaks-into-two/m-p/676929#M231486</link>
      <description>&lt;P&gt;Alternatively, if ServiceNow accepts literal newline, you can just insert newline&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval summary = replace(summary, " from ", " from
")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 08 Feb 2024 05:04:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Syntax-to-break-a-line-in-search-so-that-it-breaks-into-two/m-p/676929#M231486</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-02-08T05:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax to break a line in search so that it breaks into two lines in servicenow</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Syntax-to-break-a-line-in-search-so-that-it-breaks-into-two/m-p/676991#M231502</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp; It worked, thanks a lot &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also, could you please explain it to me, or is there any docs I may refer to?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 18:24:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Syntax-to-break-a-line-in-search-so-that-it-breaks-into-two/m-p/676991#M231502</guid>
      <dc:creator>man03359</dc:creator>
      <dc:date>2024-02-08T18:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax to break a line in search so that it breaks into two lines in servicenow</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Syntax-to-break-a-line-in-search-so-that-it-breaks-into-two/m-p/676994#M231504</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command can either extract fields from an event or replace text in an event.&amp;nbsp; In this case, &lt;FONT face="courier new,courier"&gt;mode=sed&lt;/FONT&gt; tells it to replace text.&amp;nbsp; The &lt;FONT face="courier new,courier"&gt;field=summary&lt;/FONT&gt; option restricts the command to the contents of the summary field.&lt;/P&gt;&lt;P&gt;The quoted string is the sed command to execute.&amp;nbsp; The 's' represents the substitute command.&amp;nbsp; The part after the first slash is a regular expression.&amp;nbsp; It says to look for the string "&lt;FONT face="courier new,courier"&gt;from '&lt;/FONT&gt;" followed by any number of additional characters (.*).&amp;nbsp; The parentheses create a group we'll refer back to later.&amp;nbsp; The part after the next slash is the replacement text.&amp;nbsp; It puts the "from" back, adds a newline character (\n), then adds the remainder of the original text (the group from part 1).&lt;/P&gt;&lt;P&gt;To read more about rex, see the Search Reference manual.&amp;nbsp; &lt;A href="https://docs.splunk.com/Documentation/Splunk/9.2.0/SearchReference/Rex" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/9.2.0/SearchReference/Rex&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 18:40:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Syntax-to-break-a-line-in-search-so-that-it-breaks-into-two/m-p/676994#M231504</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-02-08T18:40:18Z</dc:date>
    </item>
  </channel>
</rss>

