Splunk Search

Field Extraction using Regex

abilann
New Member

Hi Team,

I would like to extract table name from below combined event using rex. Both events are combined in one event using transaction. Can you please help,

25324/-285213840 WRK:DF_E4CAC858_tor Thu Apr 9 23:17:25.077194 dbprq.c770
doQueryDiagnostics: The following SQL query took 535 seconds which is equal to or greater than QueryExecutionTimeThreshold (4 seconds) for User(AF) with DBProxyUser(AF).
25324/-285213840 WRK:AF_E4CAC858_tor Thu Apr 9 23:17:25.080304 dbpq.c782
SELECT * FROM PRODDTA.Employee WHERE ( A=1 )

Thanks,
Abilan

0 Karma

richgalloway
SplunkTrust
SplunkTrust

See if this helps.

... | rex "(?i)FROM (?<table>\S+)"
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

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