<?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: using SEDCMD to remove repeated lines in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164385#M33320</link>
    <description>&lt;P&gt;no, since they have no timestamp splunk sees them as part of the log before it, which is fine.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Feb 2014 22:43:22 GMT</pubDate>
    <dc:creator>twistedsixty4</dc:creator>
    <dc:date>2014-02-25T22:43:22Z</dc:date>
    <item>
      <title>using SEDCMD to remove repeated lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164379#M33314</link>
      <description>&lt;P&gt;hey everyone,&lt;BR /&gt;
Our server here generates a filestamp/header at midnight or on resets that start with a line of dashes(----), then enters a line of system and log information (this is useful), then ends with another line of dashes (----). I've been trying to use SEDCMD to delete the dashed lines (including the carriage return) but it doesnt seem to be working. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-StripBreaks = s/\n?----*//g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've tried changing the name for the class, tried removing the "\n", double escaping the "\n", all of it just doesn't work. One thing that works is if I try it inline..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex mode=sed "s/\n?----*//g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I could use some help getting my head around this..&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Update:&lt;/P&gt;

&lt;P&gt;so I've tried to do this with a different issue I'm having which is repeated spaces, if I use the rex sed mode it works just fine, but the second i add it to props it falls apart. here's the second one I've tried..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-SubSpaces = s/\s\s+/ /g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;beside this i've tried changing how the SED is applied by giving it a source file instead of the sourcetype and it still doesnt work. here is the working rex for my second SEDCMD.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex mode=sed "s/\s\s+/ /g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;again, any help is appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2014 00:06:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164379#M33314</guid>
      <dc:creator>twistedsixty4</dc:creator>
      <dc:date>2014-02-25T00:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: using SEDCMD to remove repeated lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164380#M33315</link>
      <description>&lt;P&gt;From a first look, the problem may be the props.conf syntax.&lt;/P&gt;

&lt;P&gt;You have:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SED-StripBreaks = s/\n?----*//g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You may want:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-StripBreaks = s/\n?----*//g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Additionally, if the headers are showing up as individual events, you may want to look into using a null queue routing:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.1/Forwarding/Routeandfilterdatad#Discard_specific_events_and_keep_the_rest"&gt;Route and filter data&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2014 21:35:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164380#M33315</guid>
      <dc:creator>dshpritz</dc:creator>
      <dc:date>2014-02-25T21:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: using SEDCMD to remove repeated lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164381#M33316</link>
      <description>&lt;P&gt;sorry that was a problem with my syntax copying over, i did have SEDCMD there, im working off an airgapped network so i cant copy/paste. i updated with new information.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2014 22:24:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164381#M33316</guid>
      <dc:creator>twistedsixty4</dc:creator>
      <dc:date>2014-02-25T22:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: using SEDCMD to remove repeated lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164382#M33317</link>
      <description>&lt;P&gt;Can you provide an example of what the header like looks like?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2014 22:28:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164382#M33317</guid>
      <dc:creator>dshpritz</dc:creator>
      <dc:date>2014-02-25T22:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: using SEDCMD to remove repeated lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164383#M33318</link>
      <description>&lt;P&gt;its one line of dashes, maybe 30 or 40 dashes long, and its stamped throughout the log because it points to another file. the whole line is nothing but dashes, then a path to a file, then another line of dashes.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2014 22:33:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164383#M33318</guid>
      <dc:creator>twistedsixty4</dc:creator>
      <dc:date>2014-02-25T22:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: using SEDCMD to remove repeated lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164384#M33319</link>
      <description>&lt;P&gt;Are these header lines showing up as individual events in Splunk?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2014 22:37:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164384#M33319</guid>
      <dc:creator>dshpritz</dc:creator>
      <dc:date>2014-02-25T22:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: using SEDCMD to remove repeated lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164385#M33320</link>
      <description>&lt;P&gt;no, since they have no timestamp splunk sees them as part of the log before it, which is fine.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2014 22:43:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164385#M33320</guid>
      <dc:creator>twistedsixty4</dc:creator>
      <dc:date>2014-02-25T22:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: using SEDCMD to remove repeated lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164386#M33321</link>
      <description>&lt;P&gt;I'm assuming the content you want to strip looks something like this?  And that you want to remove the solid lines and keep the line in the middle.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;------------------------------------------------
some other log file ...
------------------------------------------------
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then something like this should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your-source-type]
SEDCMD-StripBreaks = s/----+[\r\n]*//g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will handle different EOL combinations (CR/CRLF/LF) and instead of consuming the leading EOL, it will remove the end.  (Unless you have lines with random trailing dashes, that you would like to keep, this should work fine.)&lt;/P&gt;

&lt;P&gt;Just to be clear, this is index-time setting which means (1) existing events already indexed will NOT be updated, and (2) you must restart Splunk for this setting to take effect.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2014 22:48:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164386#M33321</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2014-02-25T22:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: using SEDCMD to remove repeated lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164387#M33322</link>
      <description>&lt;P&gt;this worked! but your points at the end helped the most, I was stopping and restarting my server, but wasn't cleaning it, now that i think about it it makes a lot of sense to do that. thanks for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2014 23:33:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/164387#M33322</guid>
      <dc:creator>twistedsixty4</dc:creator>
      <dc:date>2014-02-25T23:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: using SEDCMD to remove repeated lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/579446#M102293</link>
      <description>&lt;P&gt;What if I need to remove the line in between the ---- lines as well?&lt;/P&gt;&lt;P&gt;Please suggest&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/70"&gt;@Lowell&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1674"&gt;@dshpritz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Dec 2021 13:42:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/579446#M102293</guid>
      <dc:creator>maria1991</dc:creator>
      <dc:date>2021-12-29T13:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: using SEDCMD to remove repeated lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/579532#M102302</link>
      <description>&lt;P&gt;Can you provide an example?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Dec 2021 23:15:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/579532#M102302</guid>
      <dc:creator>dshpritz</dc:creator>
      <dc:date>2021-12-29T23:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: using SEDCMD to remove repeated lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/579548#M102308</link>
      <description>&lt;P&gt;-----------------------------------------------------------------&lt;/P&gt;&lt;P&gt;some text&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------&lt;/P&gt;&lt;P&gt;These lines won't have any timestamps, need to complete ignore them from indexing.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2021 07:34:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/579548#M102308</guid>
      <dc:creator>maria1991</dc:creator>
      <dc:date>2021-12-30T07:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: using SEDCMD to remove repeated lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/580253#M102379</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1674"&gt;@dshpritz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------&lt;/P&gt;&lt;P&gt;some text&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------&lt;/P&gt;&lt;P&gt;These lines won't have any timestamps, need to complete ignore them from indexing.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jan 2022 11:21:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/580253#M102379</guid>
      <dc:creator>splunKR1</dc:creator>
      <dc:date>2022-01-07T11:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: using SEDCMD to remove repeated lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/580334#M102389</link>
      <description>&lt;P&gt;I think something like this would work:&lt;/P&gt;&lt;PRE&gt;SEDCMD-turnthismotherout = s/(?:^-+[\n\r$])(?:.+?[\r\n])(?:^-+[\n\r$])//g&lt;/PRE&gt;</description>
      <pubDate>Sat, 08 Jan 2022 03:18:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/using-SEDCMD-to-remove-repeated-lines/m-p/580334#M102389</guid>
      <dc:creator>dshpritz</dc:creator>
      <dc:date>2022-01-08T03:18:27Z</dc:date>
    </item>
  </channel>
</rss>

