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!

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...