Splunk Search

Splunk extraction query

lv66735
New Member

index=app_pc "Last Executed SQL" "Tablespace"
| rex field=_raw <SERVICE_NAME>(?<SERVICE_NAME>.*)</SERVICE_NAME>
| rex field=_raw <HOSTt>(?<HOST>.*)</HOST>
| rex field=_raw <host>(?<host>.*)</host>
| rex field=_raw <CONNECT_DATA>(?<CONNECT_DATA>.*)</CONNECT_DATA>
| rex field=_raw <source>(?<source>.*)</source>
| rex field=_raw <index>(?<index>.*)</index>
| rex field=_raw <sql>(?<sql>.*)</sql>
| rex field=_raw <tablel>(?<tablel>.*)</table>
|eval hour=strftime(_time,"%H")
|eval minute=strftime(_time,"%M")
|table _time, SERVICE_NAME, HOST, host,CONNECT_DATA, source, index, sql, table

I know not correct but trying to extract index and tables name of table running out of space

unable to extend index PCR.PC0000009BU5 by 8192 in tablespace PCR

and table name from SQL in Splunk. 

SELECT COUNT(*)

FROM (SELECT /* ISNULL:pcx_availablevolexcesses_ext.EffectiveDate:, ISNULL:pcx_availablevolexcesses_ext.ExpirationDate:; */ 1 as countCol

FROM pcx_availablevolexcesses_ext pcx_availablevolexcesses_ext INNER JOIN pc_policyperiod policyperiod_0 ON policyperiod_0.ID=pcx_availablevolexcesses_ext.BranchID

WHERE pcx_availablevolexcesses_ext.BranchID = ? AND ((((pcx_availablevolexcesses_ext.ExpirationDate IS NULL) OR (pcx_availablevolexcesses_ext.EffectiveDate IS NULL AND pcx_availablevolexcesses_ext.ExpirationDate <> ? AND pcx_availablevolexcesses_ext.ExpirationDate IS NOT NULL) OR (pcx_availablevolexcesses_ext.ExpirationDate <> pcx_availablevolexcesses_ext.EffectiveDate)))) AND policyperiod_0.Retired = 0 AND policyperiod_0.TemporaryBranch = '0') countTable

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

It's not clear what problem you're trying to solve.  The question contains SPL that appears to be trying to parse XML, but there is no sample XML data to go with it.  The question also contains what appears to be an error message that may be a sample event, but its relationship to the rest of the posting seems tenuous.  Finally, there is a SQL query and I have no idea why it's there.

Please clarify the question (start by asking one  😉).

---
If this reply helps you, Karma would be appreciated.
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Best Practices: Splunk auto adjust pipeline queue

When you enable autoAdjustQueue in Splunk, maxSize should be understood as the queue size Splunk starts with ...

Request for Professional Development: Attending .conf26

Winning Over the Boss: Your Pass to .conf26 conf26 is going to be here before you know it. If don't already ...