Alerting

Splunk alert fields change

raghunandan1
Engager

Hi,

I need help on below SPL query.

| eval ci= if (isnull(ci),host,ci),

As per current logic, if there is no value available in ci then it will take host name as ci. Here host value is Splunk HF.

I want should pick up server name or application name from the URL part instead of picking Splunk HF as host in ci filed.

How to change server name or application name from the URL part instead of picking Splunk HF as host in ci filed.

URL Examples : http://abcdflpqr0012.abcd.xyz.com:5050/abcd/intro.html
http://prod-abcd.xyz.com:14000/identity

Can you please help me here.

Thank you.

Labels (4)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Extract the CI from the URL and use that in the eval command.

| rex field=URL "https?:\/\/(?<url_ci>[^\.]+)"
| eval ci = coalesce(ci, url_ci)

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Extract the CI from the URL and use that in the eval command.

| rex field=URL "https?:\/\/(?<url_ci>[^\.]+)"
| eval ci = coalesce(ci, url_ci)

 

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

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

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...