Splunk Search

How to extract multiple sets of fields from one sourcetype

davidb89
Engager

I'm currently forwarding data from a pfSense Firewall in our Splunk Light instance. This works pretty well and I defined a source type for this syslog instance. In the first place, I only forwarded the firewall logs and extracted the fields by "," as a separator which works pretty well for TCP and UDP log types. But when it comes to ICMP for example the field separation does not match. This is of course correct but is there a way to define more than one set of fields to be extracted from one source type?

0 Karma

sundareshr
Legend

Technically, you can have mulitple EXTRACT directives in your props pointing to corresponding stanzas in transforms. However, the risk, in your example, is if ICMP logs have a comma in the data, it will be extracted into a field. Your better option would be to keep all the data in the same index but separate sourcetypes (TCP, UDP, ICMP). This will give your more flexibility.

Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...