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!

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...