Hi,
I'm having an issues parsing the SQL_TEXT field from oracle:audit:unified. When the field comes through it contains spurious text that isn't returned by the query using DBConnect and the oracle:audit:unified template. For example:
DBConnect
grant create tablespace to test_splunk,
Splunk
grant create tablespace to test_splunk,4,,1,,,,,,
The RAW event seems to come through as a CSV by virtue of the Oracle TA but we have a regex for the event extraction that looks like the below which seems to work in regex101:
SQL_TEXT="(?<SQL_TEXT>(?:.|\n)*?)(?=(?:",\s\S+=|"$))
I know the data type is CLOD so I have tried to converting it using the substring command but I get the same result, any idea what is going on here?
This happens because:
DB Connect is not handling CLOB properly.
It may append metadata or placeholders (such as null indicators, buffer sizes, or offsets).
Wouldn't casting this to a new data type in DBConnect fix this or is that merely converting the additional along with the other data?
I tried this and the result is the same...
@kiran_panchavat did you get a chance to review the screenshots?
@Rhidian Yes, I saw the screenshot. It looks like the SQL_TEXT field is displaying correctly within events but appears distorted or truncated when viewed in the "Interesting Fields" panel in Splunk.
Run the following search in Splunk to see if the issue persists in the search results:
index=<your_index> | table SQL_TEXT
If the data appears fine in the search results but not in the field summary panel, it's likely a UI rendering issue.
[oracle:audit:unified]
SHOULD_LINEMERGE = false
TRUNCATE = 10000
TRANSFORMS-clean_sql = clean_sql_text
[clean_sql_text]
SOURCE_KEY = SQL_TEXT
REGEX = ^([^,]+)
FORMAT = SQL_TEXT::$1
DEST_KEY = SQL_TEXT
Hello @kiran_panchavat @Rhidian maybe we could filter special characters with REGEXP_REPLACE(sql_text… in the SQL query?
Thanks.
Start with the rex solution in your search to quickly verify if you can isolate the valid SQL:
index=<your_index> sourcetype=oracle:audit:unified
| rex field=SQL_TEXT "^(?<cleaned_sql>[^,]+)"
| table cleaned_sql
If that works, apply it into props.conf and transforms.conf for a permanent fix at ingestion time. If the pattern of spurious text varies (e.g., not always commas).