Forum Discussion
keithhubb
Oct 28, 2015Employee
Combine and Modify Grep Output
Hi, I'm trying to write a script to output virtual server stats. Can anyone help me modify the output?
Right now the GREP output looks like this:
Ltm::Virtual Server: www.website.com.443
Bits In 2.1G 0 -
Bits Out 2.3G 0 -
Ltm::Virtual Server: www.website.com.80
Bits In 1.4G 0 -
Bits Out 740.8M 0 -
I need help making the output like this:
www.website.com.443 Bits In 2.1G Bits Out 2.3G
www.website.com.80 Bits In 1.4G Bits Out 740.8M
Afterwards, I can diff files from different dates, and figure out which VIPS are not being used.
- devopsdd_183664Altostratus
Here's something quick if your grep output is in output.txt:
root@dev-localhost:~ sed 'N;N;s/\n//g' output.txt | awk '{print $3, $4, $5, $6, $9, $10, $11}' www.website.com.443 Bits In 2.1G Bits Out 2.3G www.website.com.80 Bits In 1.4G Bits Out 740.8M
- keithhubbEmployee
That's perfect. Thanks very much.
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