Splunk Search

DB Connect Timestamp Search Time results

arrowsmith3
Path Finder

I have a search time query

| dbquery OEM "SELECT

regexp_replace(d.target_name, '\..*', '') AS output,
d.collection_timestamp,
d.metric_column as Metric_Type,
TO_NUMBER(d.value) as Metric
FROM sysman.mgmt$metric_details d
WHERE d.collection_timestamp >= SYSDATE - 1 and d.target_type = 'host'
and (d.target_name in ('XXX','XXXX','XXXXX','XXX')
or d.target_name like 'XXX-%'
or d.target_name like 'XXXX%'
or d.target_name like 'XXX%')
and d.metric_column = 'cpuUtil' ORDER BY collection_timestamp" | search METRIC_TYPE="cpuUtil"

I would like to leverage splunks dashboard and alerting features but I'm not sure I really need to import the entire table into a splunk index. Ideally I would like to be able to search, present and alert queried data for a time span and compare this to other datasets. My issue is the timestamp. The oracle 11g db is like 4/10/2013 4:16:48 PM %m/%m/%Y %H:%M:%S and is stored in our collection_timestamp column. I see how to fix the timestamp issue through a input stanza but I'm wondering if there is an search time method to convert the time stamp properly? Right now the collection_timestamp is converting to this 1365637246.000

Thanks!

0 Karma
1 Solution

jcoates_splunk
Splunk Employee
Splunk Employee

jcoates_splunk
Splunk Employee
Splunk Employee

Hi, I think you're looking for convert's ctime function. http://docs.splunk.com/Documentation/Splunk/5.0.2/SearchReference/Convert

Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...