Splunk Search

Extraction of Multiple events (URLS and IP addresses) from text files

capilarity
Path Finder

Hi,

We receive daily emails with lists of IOC's for malware and phishing alerts, each email may contain multiple ip address, domains and email addresses and we are trying to extract these to run searches against out web and email logs. 

I have the regex working for extraction but it will only extract the first match.

I've tried multiple ways of achieving this without success, the current config is:

Props.conf

EXTRACT-IOCURL = (?P<IOCURL>[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9][\[][\.|@][\]][^\s]{2,}|[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9][\[][\.|@][\]][^\s]{2,}|[a-zA-Z0-9]+[\[][\.|@][\]][^\s]{2,}|[a-zA-Z0-9]+[\[][\.|@][\]][^\s]{2,})

EXTRACT-IOCIP = (?P<IOCIP>\d{1,3}\[\.\]\d{1,3}\[\.\]\d{1,3}\[\.\]\d{1,3}+)


The indexed email looks like this....

....

Domains
comprised[.]site
badsite[.]studio
malware[.]live

IP addresses
192[.]254[.]71[.]78
192[.]71[.]27[.]202
193[.]182[.]144[.]67 

....

 

but the current config will only extract the first record for each:

IOCURL - comprised[.]site

and 

IOCIP  - 192[.]254[.]71[.]78.

Any ideas how to extract all the domains and IP addresses?

Thanks 

Labels (1)
0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

one way is move this to transforms.conf and use MV_ADD = 1 like in e.g. this https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-that-appears-several-times-but-...

r. Ismo

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 ...