Getting Data In

How to convert bulk evtx files in a folder to CSV files for ingestion?

sbgoldberg13
Explorer

Hi all. I have a folder with about 200 evtx files. The following command works for 1 file. How can I process/convert all of the evtx files to csv at once? Thanks.

Get-WinEvent -Path C:\somewhere\foo.evtx | Export-CSV C:\somewhere\foo.csv

 

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

This is more of an OS/shell problem than a Splunk problem.  You should able to use the shell's looping constructs to iterate over the files in the folder.

Get-ChildItem –Path "C:\somewhere" |
  Foreach-Object {
  #Do something with $_.FullName
}
---
If this reply helps you, Karma would be appreciated.
0 Karma

sbgoldberg13
Explorer

I tried this command, modified with get-winevent piped to export-csv but no luck. How do I iterate so it changes each xxx.evtx to xxx.csv, yyy.evtx to yyy.csv, etc. Thanks.

Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

That would be a question for a Powershell forum.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

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

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...