Splunk Search

How to calculate the columns and draw charts from SPLUNK DB connect query output

deepthi5
Path Finder

Hello Team,

Here is the issue scenario i am facing i have got a DB with the following columns
ID
SERVICE_NAME
SERVER_ID
volume
START TIME END TIME

I want to draw a chart using these columns. Example:For each server Total items =SUM(VOLUME), processing time= Start time- End time,
I have configured Db connect and retrieved the required columns. now i am not understanding how should i do these calculations to the db query

db query--> Select SERVICE_NAME,Volume from xxxx WHERE SERVICE_NAME='xxxx'

stats sum(Volume) as totalitems by _time,SERVER_ID

can some one tell me how should i combine both

Thanks ,
Deepthi

0 Karma

fdi01
Motivator

to combine both try like this:

|dbquery  YOUR_NAME_DB  "Select SERVICE_NAME,Volume from xxxx WHERE SERVICE_NAME='xxxx' "| stats sum(Volume) as totalitems by _time,SERVER_ID
0 Karma

deepthi5
Path Finder

I have tried that but it did not work out please help me out i am stucked here

0 Karma

vganjare
Builder

Hi deepthi5,

What output you are getting? And what is the expected output?

Thanks.

0 Karma

vganjare
Builder

Hi,

You can try using dbquery command from DBConnect app. You can also combine the splunk commands once you get the results.

http://answers.splunk.com/answers/121145/combine-db-connect-and-search-data.html

More details @ http://docs.splunk.com/Documentation/DBX/latest/DeployDBX/Commands

Thanks,
Vishal

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...