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!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...