Getting Data In

CSV with Lookup

phanikumarcs
Explorer

Hi @ITWhisperer 
@gcusello @ITWhisperer  please help

This is the other issue which is related to csv dataset and lookup dataset.

From this SPL: source="cmkcsv.csv" host="DESKTOP" index="cmk" sourcetype="cmkcsv"

Getting output below

Subscription Resource Key Vault Secret Expiration Date Months
BoB-foo Dicore-automat Dicore-automat-keycoreDi core-tuubsp1sct 2022-07-28-21
BoB-foo Dicore-automat Dicore-automat-keycore Dicore-stor1scrt 2022-07-28-21
BoB-foo G01462-mgmt-foo G86413-vaultcore G86413-secret-foo

 

From this lookup: | inputlookup cmklookup.csv
Getting output below

ApplicationenvironmentappOwner
CaliberDicore - TCG[email protected]
KeygroupG01462 - QA[email protected]
KeygroupG01462 - SIT[email protected]

 

Combine the two queries into one, where the output will only display results where the 'environment' and 'Resource' fields match. For instance, if 'G01462' matches in both fields across both datasets, it should be included in the output. How i can do this, could anyone help here to write spl. I wrote some of the Spls but it's not working for me.

source="cmkcsv.csv" host="DESKTOP" index="cmk" sourcetype="cmkcsv"
|join type=inner [ | inputlookup cmklookup.csv environment]

source="cmkcsv.csv" host="DESKTOP" index="cmk" sourcetype="cmkcsv"
| lookup cmklookup.csv environment AS "Resource" OUTPUT "environment"

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

In your example, G01462 doesn't (completely) match any entry in either Resource or environment. Lookup requires an exact match (unless you define it as a wildcard lookup or CIDR). In the case of G01462-mgmt-foo, would you want the lookup to find either G01462 - QA or  G01462 - SIT or both?

0 Karma

phanikumarcs
Explorer

Indeed, the objective is to utilize a lookup operation to match 'G01462' and find either 'G01462 - QA' or 'G01462 - SIT', or both.

Alternatively, can I modify the lookup operation to precisely match the "newResource" field with the "Resource" field to retrieve the corresponding values of the "environment" field in the

ApplicationenvironmentappOwnernewResource
CaliberDicore - TCG[email protected]Dicore-automat
KeygroupG01462 - QA[email protected]Dicore-automat
KeygroupG01462 - SIT[email protected]G01462-mgmt-foo


0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Do that then!

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!

Deep Dive: Accelerate threat investigation with Splunk’s AI Assistant in Security

AI is one of the biggest topics in the market today, and for security teams, its value goes far beyond the ...

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 ...

Detection Engineering Office Hours: Real-World Troubleshooting & Q&A

[REGISTER HERE] This thread is for the Community Office Hours session on Detection Engineering Office Hours: ...