Splunk Search

Field extraction optimisation

FunPolice
Path Finder

I want to extract the recipient and sender domains from e-mail addresses that appear in my logs. I can extract them from _raw:

EXTRACT-ToDomain = (?i)to=<[^@]*@(?<ToDomain>[^>]*)
EXTRACT-FromDomain = (?i)From=<[^@]*@(?<FromDomain>[^>]*)

or from existing fields:

EXTRACT-ToDomain = @(?P<ToDomain>[^>]*) in to
EXTRACT-FromDomain = @(?P<FromDomain>[^>]*) in From

Is one method more efficient than the other?

0 Karma
1 Solution

Ayn
Legend

Strictly speaking the second option would be a bit more efficient, but in reality I highly doubt you would be able to notice any difference.

View solution in original post

Ayn
Legend

Strictly speaking the second option would be a bit more efficient, but in reality I highly doubt you would be able to notice any difference.

Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...