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!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...