VMware Cloud Community
SCharchouf
Hot Shot
Hot Shot

Convert LOG file to CSV

I need to convert a LOG file to CSV is that possible?

0 Kudos
12 Replies
LucD
Leadership
Leadership

What kind of log?
And is this a PowerCLI related question?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
SCharchouf
Hot Shot
Hot Shot

the output is a LOG of running a PowerCLi commands to check some parameters.

the output is like this

 

2020-11-10][23:04:23] - Success - PowerCLI module exists

[2020-11-10][23:04:25] - Control - ############# Check VIB Acceptance Level #############
[2020-11-10][23:04:43] - Success -HostLab : Acceptance Level 'PartnerSupported'

[2020-11-10][23:04:46] - Success -Host1 : Acceptance Level 'PartnerSupported'

[2020-11-10][23:04:46] - Control - ############# Check NTP Configuration #############

0 Kudos
LucD
Leadership
Leadership

Moved post to VMware PowerCLI Discussions


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
LucD
Leadership
Leadership

What fields/columns do you want in the CSV?
How should these lines be split?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
LucD
Leadership
Leadership

A question though.
Why first go through the trouble of showing that information in a log and then converting that log into a CSV.
It would be a lot simpler to write to a CSV directly


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

SCharchouf
Hot Shot
Hot Shot

I need the LOG as it's mandatory as a proof of activity

the reason why I'm trying to convert to CSV in order to explore data in Excel 😊

0 Kudos
LucD
Leadership
Leadership

You can create a log from the CSV, which imho is way easier than creating a CSV from a log.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
SCharchouf
Hot Shot
Hot Shot

it would be a greate idea but not sure how to proceed 🙂

and I believe this is will require a huge change in the script, right?

0 Kudos
LucD
Leadership
Leadership

I can't really tell without seeing the script and how you create those log lines.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

SCharchouf
Hot Shot
Hot Shot

Totally agree, may I share it in private?

0 Kudos
LucD
Leadership
Leadership

Sure, send me a PM


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
SCharchouf
Hot Shot
Hot Shot

sorry for the delay, Message sent

since the update I no longer receive notifications. I will check the configuration of my profile.

0 Kudos