Splunk Search

Regex pattern for url patterns to show as a single url in Dashboard

vickycoder27
Explorer

We have some below Regex patterns that have special characters, alphabets & digits and wanted them as a showing up as a single url in Dashboard as "/my-list/my-group/fetchGroup":

url=/my-list/my-group/MY_SPL_%26%5E%26%25%5E%26%23%25%24%5E%26%25%26%2A%25%2B%29%21%24%23%24%25%26%5E_new
url=/my-list/my-group/MY_SafeList_automation
url=/my-list/my-group/RfdL4fSjmS
url=/my-list/my-group/Bug%20May%20Be%20User%20Notification

I wrote one for digits as below and wanted for combination of special characters, alphabets & digits
(
url="bug/364756748/types" --->>> eval url=replace(url,"\/bug\/\d+.*\/types","bug/types")
)

0 Karma

grittonc
Contributor

Try this regular expression, assuming that the characters between the first two pairs of / are either letters or "-":

...
| rex field=url "(?<url_group>\/[\w-]+\/[\w-]+\/).*" | eval url_group=url_group+"fetchGroup"
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Using rex is the hard way to do that. Try urldecode, instead.

... | eval url=urldecode(url) | ...
---
If this reply helps you, Karma would be appreciated.
0 Karma

vickycoder27
Explorer

Kind or partially worked with below regex(except the special characters like % ! $) :"\/my-list\/my-group\/\w+.*"

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...