Getting Data In

Help with SEDCMD-drop

cboillot
Contributor

Here is my issue, i have logs that look like this:

<--CT<-- --------------------------------------------------
10:10:23 AM  Application Directory: A:\bdir\Cdir\Aapp
The last GET occurred at 1/24/2020 10:10:23 AM
-------------------------------------------------- -->
--/>
<--CT<-- --------------------------------------------------
10:10:20 AM  Application Directory: A:\bdir\Cdir\Bapp
The last GET occurred at 1/24/2020 10:10:20 AM
-------------------------------------------------- -->
--/>

When use the following SEDCMD-drop = s/<--CT<-- |-+| -->|>|\/>//g I get

10:10:23 AM  Application Directory: A:\bdir\Cdir\Aapp
The last GET occurred at 1/24/2020 10:10:23 AM



10:10:20 AM  Application Directory: A:\bdir\Cdir\Bapp
The last GET occurred at 1/24/2020 10:10:20 AM

How do I go about getting rid those extra blank lines?

Tags (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Include line ends in your regex and it should eliminate the blank lines.

SEDCMD-drop = s/<--CT<-- |-+\n?| -->\n|>|\/>\n//g

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Include line ends in your regex and it should eliminate the blank lines.

SEDCMD-drop = s/<--CT<-- |-+\n?| -->\n|>|\/>\n//g

---
If this reply helps you, Karma would be appreciated.
0 Karma

cboillot
Contributor

Although this didn't work 100% for me ( it added an / to a 3rd line), it got me going in the right direction, what I ended up using was SEDCMD-drop = s/<--CT<-- |-+\n?| -->\n|>|\/>//g

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...