Splunk Search

extract subject from maillog

dictudatacom
New Member

Hi, I want to extract the 'subjects' from my SMTP maillog but the regex I have built doesn't seem to work. I have built the same type of regex to extract the FROM en TO fields and that works so I'm puzzled why it doesn't extract the subjects...

Regex looks like this:

(?i) subject <(?P[^>]*)

Can anyone help me out ? Thanks in advance!

Tags (1)
0 Karma

suepfarrell
New Member

Thx jstockamp - that didn't quite work. I will give more detail in my own question I think. About to go set one up now.
Thanks

0 Karma

jstockamp
Communicator

Your regex should looking something like this.

Subject.'(?.*)'

0 Karma

suepfarrell
New Member

Hi

Did you get an answer for this - trying to do this myself. My email subjects differ so I want to table them all

How did you end up extracting the subject lines?

Thanks
Sue

0 Karma

dictudatacom
New Member

Hi Ayn, here is a sample of the logfile, I want to extract the subject:

Mon Jul 2 10:20:38 2012 Info: Start MID 62771585 ICID 33896658
Mon Jul 2 10:20:38 2012 Info: MID 62771585 ICID 33896658 From: <*****>
Mon Jul 2 10:20:38 2012 Info: Delivery start DCID 24405838 MID 62771584 to RID [0]
Mon Jul 2 10:20:38 2012 Info: MID 62771585 ICID 33896658 RID 0 To: <
*>
Mon Jul 2 10:20:38 2012 Info: MID 62771585 Message-ID '2B2E0EB229A8F44AB8C55D5E296BCFC40C584F@SCOMP0934.wurnet.nl'
Mon Jul 2 10:20:38 2012 Info: MID 62771585 Subject 'FW: Postbus AgroFood vanaf vrijdag 17:00 VOL: opnieuw inzenden!!'
Mon Jul 2 10:20:38 2012 Info: MID 62771585 ready 19724 bytes from <
****>
Mon Jul 2 10:20:38 2012 Info: MID 62771585 matched all recipients for per-recipient policy DEFAULT in the outbound table
Mon Jul 2 10:20:38 2012 Info: MID 62771585 interim AV verdict using Sophos CLEAN
Mon Jul 2 10:20:38 2012 Info: MID 62771585 antivirus negative

0 Karma

jfraiberg
Communicator

have you tried using the "extract fields" dropdown from one of the events?

0 Karma

Ayn
Legend

Please include a log sample. Without it it's hard to build a regex that should match.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...