Knowledge Management

Extracting Text/Field from _raw Microsoft Event For Failed Backups

SplunkLunk
Path Finder

Greetings,

I want to run a report/alert when a MSSQL backup job has failed. It looks like the info I want is only displayed in the _raw field. Can anyone tell me how I can use the rex command to get the name of the database that has failed? The _raw event data looks like this:

2017-11-27 12:34:33.71 Backup BACKUP failed to complete the command BACKUP DATABASE WideWorldImportersDW. Check the backup application log for detailed messages.

The name of the database in this case is "WideWorldImportersDW". However, other database names will always be sandwiched between "BACKUP DATABASE" and ". Check" Can someone help me craft the rex expression to give me the text between "BACKUP DATABASE" and ". Check"? Thanks for any assistance.

Tags (1)
0 Karma
1 Solution

woodcock
Esteemed Legend

Do this:

Your Search Here
| rex "BACKUP DATABASE (?<DBName>\S+). Check"
| search NOT DBName="*"

Refine your rex until none of your events are making it past the last search filter line.

View solution in original post

0 Karma

woodcock
Esteemed Legend

Do this:

Your Search Here
| rex "BACKUP DATABASE (?<DBName>\S+). Check"
| search NOT DBName="*"

Refine your rex until none of your events are making it past the last search filter line.

0 Karma

SplunkLunk
Path Finder

So, this is what I've tried and it seems to work:

|rex field=_raw "BACKUP DATABASE (?[^\s]+). Check"

Is there a better way? I'm not sure if this will miss any events. Maybe there is a better way.

0 Karma
Get Updates on the Splunk Community!

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

&#x1f5e3; You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...

Splunk New Course Releases for a Changing World

Every day, the world feels like it’s moving faster with new technological breakthroughs, AI innovation, and ...

Insights from .conf 2025, Smart Edge Processor Scaling, and a New Splunk Lantern ...

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