Splunk Search

How to extract a field that is within an already extracted field?

krishnacasso
Path Finder

Hi Ninja

I've done a field extraction for apache access log like Referer.

Referer= http(s)://FQDN/Abc/dasd/sadfasf/

Now I am trying to get only FQDN from the referer but field extractions is not allowing me to do this since that FQDN is already in a field I extracted.

I want to create a table with count of unique FQDN

Application               Count
FQDN1                       4
FQDN2                       30

Thanks.

0 Karma

woodcock
Esteemed Legend

Check out these great apps:

URL Parser: https://splunkbase.splunk.com/app/1545/
URL Toolbox: https://splunkbase.splunk.com/app/2734/
URL Expander (what is that tinyurl?): https://splunkbase.splunk.com/app/3460/

0 Karma

gokadroid
Motivator

If you are happy to extract it in SPL (same regex can be used elsewhere like field extractor) then try to see if this works for you:

your base query to give field Referer
| rex field=Referer "https?:\/\/(?<FQDN>[^\/]+)\/.*"
| stats count by FQDN

See extraction here

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...