Splunk Search

How can I extract all fields from my DB Connect results in Splunk?

jroeser1404
Loves-to-Learn Everything

I have configured a Database Input in DB Connect to pull in data from an Oracle view. A sample string from one of the events follows:

2023-02-28 15:40:50.760, AUDIT_TYPE="Standard", OS_USERNAME="Administrator", TERMINAL="unknown", DBUSERNAME="RACOON", CLIENT_PROGRAM_NAME="SQL Developer", STATEMENT_ID="978", EVENT_TIMESTAMP="2023-02-28 18:40:50.76", ACTION_NAME="ALTER USER",  OBJECT_NAME="SPLUNK", SQL_TEXT="ALTER USER "SPLUNK" DEFAULT ROLE "CONNECT","AUDIT_VIEWER"", SYSTEM_PRIVILEGE_USED="SYSDBA", CURRENT_USER="SYS", UNIFIED_AUDIT_POLICIES="ORA_SECURECONFIG"

However, when I run this search the fields are not correctly identified:

index=oracle_audit sourcetype=ID source=OracleAuditConnection

Specifically, what should be fields like TERMINAL, CLIENT_PROGRAM_NAME, and OS_USERNAME (among many others) are not identified as fields. Additionally, the search is picking up values as fields, that should not be fields at all (often from the SQL_TEXT field). For example, "ACTIONS ALTER ON SPLUNK.BAT" is picked up as a field, rather than a value.

I can improve the results a little by using the following:

index=oracle_audit sourcetype=ID source=OracleAuditConnection  | extract pairdelim="\"{,}"

However, it still does not correctly identify all the fields. Nor does it work on the more complicated SQL_TEXT field, which may contain quotations and the equals signs at time.

What can I do to successfully have all of my fields extracted? Is there any trick I can do, given that I am using DB Connect?

Labels (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Splunk usually parses well events with fields in the format key=value, but stumbles when the value field contains embedded (and unescaped) quotation marks.  The ID sourcetype needs settings added or modified in a props.conf file to properly parse that data.  You may need a transform to parse the event using a regular expression.

Please share the current props.conf settings for the ID sourcetype.

---
If this reply helps you, Karma would be appreciated.
0 Karma

jroeser1404
Loves-to-Learn Everything

Thank you for your reply! I'm still learning Splunk and just let the settings default to whichever for the sourcetype. However, I did find this:

https://docs.splunk.com/Documentation/AddOns/released/Oracle/Datatypes

I am pulling data in from the UNIFIED_AUDIT_TRAIL view in Oracle, which I believe would correspond to the oracle:audit:unified sourcetype in the above link. I installed the Splunk Add-On for Oracle Databases, then went to settings > source types. I verified that oracle:audit:unified existed.

I then cloned my Database Input, and changed Source Type from "ID" to "oracle:audit:unified". Yet despite doing this, it seems that the sourcetype is not being applied for some reason.

When I view the Advanced column of the oracle:audit:unified, it has all the rules I would expect for cleaning out my data (specifically the SQL_TEXT column). Yet it doesn't seem to be applied to my search. What am I doing wrong here?

I have not made any changes to props.conf for oracle:audit:unified.


Please see below: 

image.pngimage.png

0 Karma

Thnai
Observer

hi @jroeser1404 

i have the exact same issue, did you resolve this maybe?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...