LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-20-2024, 10:08 AM   #1
walkomar
LQ Newbie
 
Registered: May 2023
Posts: 1

Rep: Reputation: 0
hping3 - how to remove DUP! column from output?


I would like to do ping on TCP port via hping3 with below command. But in some output I got "DUP!" extra column, which put into the trouble. I am doing some awk commands and this extra columns give me mess in my current approach to usual output (where I don't have "DUP!"). Do you know any option, which can turn this off? I have gone through hping3 manual and I didn't find anything, which can be connected with this. What can help in this case?
unbuffer hping3 -S -p 443 10.1.4.30 | while read pong; do echo "$(date): $pong"; done
Fri May 10 05:25:04 CEST 2024: len=46 ip=10.1.50.62 ttl=64 DF id=0 sport=443 flags=RA seq=237971 win=0 rtt=11.1 ms
Fri May 10 05:25:03 CEST 2024: len=46 ip=10.1.50.62 ttl=64 DF id=0 sport=443 flags=RA seq=237970 win=0 rtt=5.1 ms
Wed May 8 09:16:53 CEST 2024: DUP! len=46 ip=10.1.4.200 ttl=126 DF id=25286 sport=445 flags=SA seq=79253 win=8192 rtt=3003.1 ms
Wed May 8 10:42:11 CEST 2024: DUP! len=46 ip=10.1.4.200 ttl=126 DF id=30404 sport=445 flags=SA seq=84370 win=8192 rtt=3003.5 ms
Thu May 9 00:48:43 CEST 2024: DUP! len=46 ip=10.1.4.200 ttl=126 DF id=15643 sport=445 flags=SA seq=135155 win=8192 rtt=3303.8 ms
 
Old 05-20-2024, 01:45 PM   #2
lvm_
Member
 
Registered: Jul 2020
Posts: 984

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
Since you are already using awk, add gsub("DUP! ","") before processing.
 
Old 05-20-2024, 09:35 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,153

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Or if it truly is a duplicate, and you don't have logic to handle that, just skip the entire record (in awk).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert two column output into 4(+) column output beeblequix Linux - Enterprise 4 09-26-2011 08:41 PM
Hping3 Installation mayursingru Linux - Software 3 02-20-2011 01:45 PM
[SOLVED] how to test server security with hping3 golden_boy615 Linux - Security 4 02-15-2011 11:01 AM
can't compile hping3 - net/bpf.h: No such file or directory ddaas Fedora 3 08-25-2007 03:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration