Splunk Search

Multiple csvs in one search

yuwtennis
Communicator

Hi!

I am creating a search that needs to create 2 csvs in one search.

Best way is to

search xxxxx | ..... | outputcsv test.csv | outputcsv test2.csv.

but this is not good.

Is there a way to implement this?

Thanks,
Yu

Tags (2)
0 Karma

yuwtennis
Communicator

Hello adityapavan18.

Thank you for the reply.

I have to create two files that does following things.

  1. Keep Track of overall number of events processed in schedule events.

  2. Create fields for external application by csv

These two has to be done in one search.

Thanks,
Yu

0 Karma

norbert_hamel
Communicator

You can append a 2nd search, something like:

index=myindex | head 5 | outputlookup test1.csv | append [ search index=myindex head 10 | outputlookup test2.csv ]

0 Karma

yuwtennis
Communicator

Hello norber.

Thank you for the reply.

But this way its like two different search exists in one search.

I want to do something like:

index = myindex | eval f1 = 1 | eval f2 = 2 | table f1 | outputcsv test1.csv | table f2 | outputcsv test2.csv

Would this be possible?

Thanks,
Yu

0 Karma

adityapavan18
Contributor

I think that is the only way to create same copies of a csv
out of curiosity..why do you need two files.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

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