Getting Data In

how to discard lines of an event, not the entire event

alexl1
Path Finder

hello,

I am trying nullQueue but I think it discards the entire event, is there a syntax that just discards lines but keeps the rest of the event? This is for a multiline event. Thanks,

Tags (1)

hexx
Splunk Employee
Splunk Employee

No, if you really want to discard part of an event you're going to need to use a SEDCMD directive in props.conf:

SEDCMD-<name> = <sed script>
* Only used at index time.
* Commonly used to anonymize incoming data at index time, such as credit card or social
  security numbers. For more information, search the online documentation for "anonymize
  data."
* Used to specify a sed script which Splunk applies to the _raw field.
* A sed script is a space-separated list of sed commands. Currently the following subset of
  sed commands is supported:
        * replace (s) and character substitution (y).
* Syntax:
    * replace - s/regex/replacement/flags
            * regex is a perl regular expression (optionally containing capturing groups).
            * replacement is a string to replace the regex match. Use \n for backreferences,
              where "n" is a single digit.
            * flags can be either: g to replace all matches, or a number to replace a specified
              match.
    * substitute - y/string1/string2/
            * substitutes the string1[i] with string2[i]

hexx
Splunk Employee
Splunk Employee

Try:

[my_sourcetype]
SEDCMD-null = s/^Status_.*$//
0 Karma

alexl1
Path Finder

does this look right, it's not deleting the lines yet

[my_sourcetype]
SEDCMD-null = s/^Status_[^$]*$//
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...