Splunk Search

regular expression ( Alert)

Michael_Schyma1
Contributor

I want to create an alert everytime that /p01 (and the rest of the file name which will vary) goes over 80%. There are different path names inside the file, but this is what im trying to extract: (Werid Spacing)

This is the rex that i have so far:

[0-9][0-9]%(?<cname>./p0\S+)




                      14G  9.6G  3.6G  73% /p01

/dev/mapper/data-mqmlv

                  4.0G   46M  3.7G   2% /p01/app/mqm

/dev/mapper/data-wilylv

                  5.0G  1.1G  3.7G  22% /p01/app/wily

/dev/dasd1 23G 6.1G 15G 29% /p01/app/was/appserver/70

Tags (1)
0 Karma

jonuwz
Influencer

nice to see some some WAS and MQ action going on : )

0 Karma

jonuwz
Influencer
(?<disk_full_perc>[0-9]{1,3})%\s+(?=/p01)(?<mount_point>.*$)

(?<disk_full_perc>[0-9]{1,3})%

Look for 1-3digits follwoed by a % - assign to disk_full_perc

\s+

allow some whitespace

(?=/p01)

assert the next part of the string is /p01 (without the regex actually moving ahead)

(?<mount_point>.*$)

stick from /p01 to the end of the line in mount_point

Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...