Getting Data In

Discard one or more fields of a specific event without losing the rest of the fields of this event?

jfeitosa_real
Path Finder

Hi All,

Please, how to discard one or more fields of a specific event without losing the rest of the fields of this event?

It's possible?

Thank you very much in advance.

James

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Those are two fairly small fields. Unless all events contain them, you're likely not saving much by eliminating them. The example I cited removed hundreds of characters from verbose Windows events.

If you still want to do it, the trick is to create a regular expression that parses your event into groups of wanted and unwanted text. Then the FORMAT setting puts only the wanted groups into the event.

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

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust
0 Karma

jfeitosa_real
Path Finder

@richgalloway . In my case, they are Fortigate firewall logs.
How would it work if I were to discard the fields srcintfrole = "undefined" and dstintfrole = "undefined" for example.

See log example:

Jan 4 15:02:17 10.1.1.1 date=2019-01-04 time=15:04:13 devname="fwA1" devid="FWA11" logid="0000000010" type="traffic" subtype="forward" level="notice" vd="root" eventtime=1546621453 srcip=10.2.2.1 srcport=54256 srcintf="port1" srcintfrole="undefined" dstip=216.152.102.6 dstport=443 dstintf="port1" dstintfrole="undefined" sessionid=410471 poluuid="1348e-602-5e8-7fb-bfbab974" dstcountry="Brazil" srccountry="Reserved" service="HTTPS" wanoptapptype="web-proxy" proto=6 action="accept" duration=0 policyid=103 policytype="proxy-policy" user="USER1" group="G-Default" wanin=0 rcvdbyte=0 wanout=0 lanin=1418 sentbyte=1418 lanout=2561 appcat="unscanned" utmaction="allow" countweb=1

Thanks!

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Those are two fairly small fields. Unless all events contain them, you're likely not saving much by eliminating them. The example I cited removed hundreds of characters from verbose Windows events.

If you still want to do it, the trick is to create a regular expression that parses your event into groups of wanted and unwanted text. Then the FORMAT setting puts only the wanted groups into the event.

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

jfeitosa_real
Path Finder

Just by complementing, it would be a way to reduce the size of the log by reducing license consumption before indexing the events.

Thanks!

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...