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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...