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!

Mission Control | Explore the latest release of Splunk Mission Control (2.3)

We’re happy to announce the release of Mission Control 2.3 which includes several new and exciting features ...

Cloud Platform | Migrating your Splunk Cloud deployment to Python 3.7

Python 2.7, the last release of Python 2, reached End of Life back on January 1, 2020. As part of our larger ...

Splunk Observability Cloud | Enhancing Your Onboarding Experience with the ...

We understand that your initial experience with getting data into Splunk Observability Cloud is crucial as it ...