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!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...