Getting Data In

Append and Update the CSV from a search output

gozdeyildiz
New Member

Hello,

I have a search which gives the output of the fields a and b. I am saving those outputs to a csv lets say output.csv. I would like to update with the latest value of the value a and b which means I do not want old/duplicate values for a and b and append non-existing values to the CSV file . I tried to do it with the left join but I was not successful.

Example: from the search fields below output is populated and writen to the csv.

name - age

bob 23
joey 33

and from another search fields below output is populated

name - age

joey 43

So I want my output.csv files to become below format.

name - age

bob 23
joey 43

Any help?

Bests!

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

CSV files must be updated in their entirety. The usual method is to read in the CSV, append the results of a search, deduplicate the results, and write them to the CSV.

| inputlookup output.csv
| append [ <your search> ]
| dedup name
| outputlookup outputs.csv
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

CSV files must be updated in their entirety. The usual method is to read in the CSV, append the results of a search, deduplicate the results, and write them to the CSV.

| inputlookup output.csv
| append [ <your search> ]
| dedup name
| outputlookup outputs.csv
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...