Splunk Search

How to convert CSV lookup to DBXlookup?

LearningGuy
Motivator


How to convert CSV lookup to DBXlookup?
The lookup using CSV worked just fine.
The CSV was moved to the database and when I converted lookup to DBXLookup, it didn't work.

Please suggest. Thanks

The following is only an example of a concept what I am trying to do, but it's not a real data.
I don't know how to simulate index vs dbxquery on a test data.

index=vuln_index

| lookup host_ip.csv ip_address as ip OUTPUTNEW ip_address, hostname, os_type

| dbxlookup connection="test" query="select * from host_ip"   ip_address as ip OUTPUTNEW ip_address, hostname, os_type

Data CSV => DBX

ip_addresshostnameostype
192.168.1.1host1ostype1
192.168.1.2host2ostype2
192.168.1.3host3ostype3
192.168.1.4host4ostype4


index=vuln_index   

ipvuln
192.168.1.1vulnA
192.168.1.1vulnB
192.168.1.2vulnC
192.168.1.2vulnD

 

Expected result

ip_addresshostnameostypevuln
192.168.1.1host1ostype1vulnA
192.168.1.1host1ostype1vulnB
192.168.1.2host2ostype2vulnC
192.168.1.2host2ostype2vulnD
Labels (2)
Tags (1)
0 Karma

KendallW
Contributor

Hi @LearningGuy , does the query return any results when you run it on the DB directly?

select * from host_ip

 

Also noticed you have "os_type" in your query vs "ostype" in your lookup. Could be the issue 🙂 

 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...