Splunk Search

How to integrate dbxquery query with Splunk search

aditsss
Motivator

 

 

Labels (1)
0 Karma

aditsss
Motivator
 
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Patience, Grasshopper.  You posted on a Sunday when most users are living their lives rather than hanging out here.  Even on work days, it may take a while to get an answer, especially when the question doesn't describe the desired result.

Have you tried using append to combine the two queries?

|dbxquery query="SELECT \"id\", \"name\", \"chain\" FROM flows;" connection="Postgres"
| append [ search index=xyz sourcetype=xy source="logs" groups (CLIENT_Id ="*") |rex field=Request_URL "\/(?<Group>[^\/]+)$"
  | convert timeformat="%Y-%m-%d" ctime(_time) AS Date
  | stats count by Date CLIENT_Id GroupRequest_URL
  | sort - CLIENT_Id
  | rename Group as id ]
| stats values(*) as * by id

 

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

aditsss
Motivator
 
0 Karma

richgalloway
SplunkTrust
SplunkTrust
Remove the final stats command and check the results to see if the DB fields are present.
---
If this reply helps you, Karma would be appreciated.
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, ...