Forum Discussion
nkingcade_12003
Nimbostratus
Sep 05, 2013Export to Excel or .CSV
I would like to export CLI information, mostly performance information, to MSExcel or to a CSV file. I tried redirection from the command line. Is this redirection possible?
uni
Altocumulus
Sep 06, 2013Jason's method above is great if it is long term. For a quick-and-dirty solution, this perl will convert your output for you. Put it in a file, such as field-to-csv, and run it like this:
tmsh show ltm virtual field-fmt raw | field-to-csv
!/usr/bin/perl
while ($line = <>) {
chomp($line);
if ($line =~ /{/) { $out = ""}
elsif ($line =~ /}/) { print "$out\n" }
else {
$out .= "," if (length($out) != 0);
($field,$value) = split(" ",$line,2);
if ($value =~ /,/)
{ $out .= "\"$value\"" }
else
{ $out .= $value }
}
}
- uniSep 06, 2013
Altocumulus
finally got the formatting right - gratlmichael_22Feb 29, 2016
Nimbostratus
Has anyone the script ready for the export the performance data to csv? mem usage, packets, ssl transactions, http,.. Thanks!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects