<?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: Can i remove blank lines in my event ?? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Can-i-remove-blank-lines-in-my-event/m-p/143839#M29370</link>
    <description>&lt;P&gt;This works for me in props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[foo]
SEDCMD-spaces = s/[\n\r]+|\s\s+//g
TIME_FORMAT = %d-%b-%y:%H-%M-%S
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;for turning this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;26-JUL-13:10-23-34 &amp;lt;Envelop          e&amp;gt;    

&amp;lt;sample

&amp;gt;
Text


&amp;lt;/sample&amp;gt;

&amp;lt;/    Envelope    &amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;into this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;26-JUL-13:10-23-34 &amp;lt;Envelope&amp;gt;&amp;lt;sample&amp;gt;Text&amp;lt;/sample&amp;gt;&amp;lt;/Envelope&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note: Depending on your XML, removing all multi-space blocks entirely may damage the XML. For example, if you have this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;foo  bar="baz" /&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and remove the double space to get this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;foobar="baz" /&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you may be in trouble.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Nov 2013 08:41:35 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2013-11-20T08:41:35Z</dc:date>
    <item>
      <title>Can i remove blank lines in my event ??</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-i-remove-blank-lines-in-my-event/m-p/143834#M29365</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I have an so many blanklines , and whitespaces in a single event , Now i want to strip of these blank lines , and mutliple whitespaces ignoring a single whitespace. How can i do this using SEDCMD prop in props.conf&lt;/P&gt;

&lt;P&gt;I have tried the following configuration,in props.conf&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;SEDCMD-parse1 = s/(?m)\n//g s/   *//g&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;s/(?m)\n//g - to remove blanklines&lt;BR /&gt;
s/   *//g  - to remove mutliple whitespaces&lt;/P&gt;

&lt;P&gt;but this doesnt work ? any better idea of doing this pls ?&lt;/P&gt;

&lt;P&gt;My sample event :&lt;/P&gt;

&lt;P&gt;`&lt;BR /&gt;
26-JUL-13:10-23-34 &lt;ENVELOP e=""&gt;    &lt;/ENVELOP&gt;&lt;/P&gt;

&lt;P&gt;&amp;lt;sample&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Text&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;lt;/    Envelope    &amp;gt;&lt;BR /&gt;
`&lt;/P&gt;

&lt;P&gt;Now i am expecting the following output,&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
26-JUL-13:10-23-34 &lt;ENVELOPE&gt;&lt;SAMPLE&gt;Text&lt;/SAMPLE&gt;&lt;/ENVELOPE&gt;&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;Sry i am unable to post sample event also, it has the above data splitted by lines and whitespaces . any idea on this SEDCMD pls?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2013 07:00:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-i-remove-blank-lines-in-my-event/m-p/143834#M29365</guid>
      <dc:creator>rakesh_498115</dc:creator>
      <dc:date>2013-11-15T07:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can i remove blank lines in my event ??</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-i-remove-blank-lines-in-my-event/m-p/143835#M29366</link>
      <description>&lt;P&gt;Give this a try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-spaces = s/[\n\r]+|\s\s+//g
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Nov 2013 13:15:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-i-remove-blank-lines-in-my-event/m-p/143835#M29366</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-11-15T13:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can i remove blank lines in my event ??</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-i-remove-blank-lines-in-my-event/m-p/143836#M29367</link>
      <description>&lt;P&gt;Hi Martin..thanks for the update .. but this is working in query.but not working in props.conf..&lt;/P&gt;

&lt;P&gt;myquery:&lt;/P&gt;

&lt;P&gt;index="default" sourcetype="mydata" source="/splunkInput/Parsing/parse4.1_2013-07-2616.32.15.log" | rex mode=sed "s/*//g" | rex mode=sed "s/[\n\r]+|\s\s+//g"&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2013 13:19:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-i-remove-blank-lines-in-my-event/m-p/143836#M29367</guid>
      <dc:creator>rakesh_498115</dc:creator>
      <dc:date>2013-11-18T13:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Can i remove blank lines in my event ??</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-i-remove-blank-lines-in-my-event/m-p/143837#M29368</link>
      <description>&lt;P&gt;What's your props.conf content?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2013 15:30:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-i-remove-blank-lines-in-my-event/m-p/143837#M29368</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-11-18T15:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can i remove blank lines in my event ??</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-i-remove-blank-lines-in-my-event/m-p/143838#M29369</link>
      <description>&lt;P&gt;Hi martin, Here is my props setting,&lt;/P&gt;

&lt;P&gt;[mydata]&lt;BR /&gt;
NO_BINARY_CHECK = 1&lt;BR /&gt;
SHOULD_LINEMERGE = true&lt;BR /&gt;
pulldown_type = 1&lt;BR /&gt;
SEDCMD-parse1 = s/*//g&lt;BR /&gt;
SEDCMD-parse2 = s/[\n\r]+|\s\s+//g&lt;/P&gt;

&lt;P&gt;I have used above parse s/*//g to remove the special * which is avaiable in my log data along with blank lines and whitespaces ..&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:18:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-i-remove-blank-lines-in-my-event/m-p/143838#M29369</guid>
      <dc:creator>rakesh_498115</dc:creator>
      <dc:date>2020-09-28T15:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can i remove blank lines in my event ??</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-i-remove-blank-lines-in-my-event/m-p/143839#M29370</link>
      <description>&lt;P&gt;This works for me in props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[foo]
SEDCMD-spaces = s/[\n\r]+|\s\s+//g
TIME_FORMAT = %d-%b-%y:%H-%M-%S
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;for turning this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;26-JUL-13:10-23-34 &amp;lt;Envelop          e&amp;gt;    

&amp;lt;sample

&amp;gt;
Text


&amp;lt;/sample&amp;gt;

&amp;lt;/    Envelope    &amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;into this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;26-JUL-13:10-23-34 &amp;lt;Envelope&amp;gt;&amp;lt;sample&amp;gt;Text&amp;lt;/sample&amp;gt;&amp;lt;/Envelope&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note: Depending on your XML, removing all multi-space blocks entirely may damage the XML. For example, if you have this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;foo  bar="baz" /&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and remove the double space to get this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;foobar="baz" /&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you may be in trouble.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2013 08:41:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-i-remove-blank-lines-in-my-event/m-p/143839#M29370</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-11-20T08:41:35Z</dc:date>
    </item>
  </channel>
</rss>

