cat filename.txt
awk '{print substr($0,85,19)}' filename.txt
awk '{print substr($0,85,19)}' filename.txt | grep -o '[^=]*$' (getting dport numbers)
Getting 1st line of output
awk 'NR==1 {print substr($0,85,19)}' filename.txt | grep -o '[^=]*$'
if that is what you seek .. if not google is wonder you can find loads of scripts there :=)
Hi all,
I have the following data in a file x.csv:
> ,this is some text here
> ,,,,,,,,,,,,,,,,2006/11/16,0.23
> ,,,,,,,,,,,,,,,,2006/12/16,0.88
< ,,,,,,,,,,,,,,,,this shouldnt be deleted
I need to use SED to match anything with a > in the line and delete that line, can someone help... (7 Replies)
Hi there,
I need help about using sed. Iam using sed to delete and print lines that match the port number as listed in sedfile. I am using -d and -p command for delete match port and print them respectively. However, the output is not synchonize where the total deleted lines is not similar with... (3 Replies)
Hi,
If there exist multiple pattern in a file, how can I find the last record matching the pattern through perl.
The below script searches for the pattern everywhere in an input file.
#! /usr/bin/perl -s -wnl
BEGIN {
$pattern or
warn"Usage: $0 -pattern='RE' \n" and
exit 255;... (5 Replies)
Hi,
I have script like below:
#!/usr/local/bin/perl
use strict;
use warnings;
while (<DATA>) {
( my ($s_id) = /^\d+\|(\d+?)\|/ ) ;
if ( $s_id == 1 ){
s/^(.*\|)*.*ABC\.pi=(+|+)*.*ABC\.id=(\d+|+).*$/$1$2|$3/s;
print "$1$2|$3\n"; (2 Replies)
Hi,
I have two files file1.txt and file2.txt. Please see the attachments.
In file2.txt (which actually is a diff output between two versions of file1.txt.), I extract the pattern corresponding to 1172c1172. Now ,In file1.txt I have to search for this pattern 1172c1172 and if found, I have to... (9 Replies)
Hi,
i need help to delete all the lines between 2 matched patterns and the first pattern must be deleted too. sample as follows:
inputfile.txt
>kump_1
...........................
...........................
>start_0124
dgfhghgfh
fgfdgfh
fdgfdh
>kump_2
............................. (7 Replies)
Hi experts,
I have a file with regexes which is used for automatic searches on several files (40+ GB).
To do some postprocessing with the grep result I need the matching line as well as the match itself.
I know that the latter could be achieved with grep's -o option. But I'm not aware of a... (2 Replies)
Hi I want to print the line until pattern is matched.
I am using below code:
sed -n '1,/pattern / p' file
It is working fine for me , but its not working for exact match.
sed -n '1,/^LAC$/ p' file
Input:
LACC FEGHRA 0
LACC FACAF 0
LACC DARA 0
LACC TALAC 0
LAC ILACTC 0... (8 Replies)
Hello,
I have been trying to write a script where I could get awk to delete data before and after a matched pattern.
For eg
Raw data
Start
NAME = John
Age = 35
Occupation = Programmer
City = New York
Certification Completed = No
Salary = 80000
End
Start
NAME = Mary
Age = 25... (2 Replies)
I have a file change.sed
more change.sed
I fire the below command inorder to replace "190.169.11.15" with "10.4.112.240" in proxy.logsed -f change.sed proxy.log proxy.log has the below entry
more proxy.log
The command replaces both 190.169.11.15 & 190.169.11.155 as below:
I am expecting... (17 Replies)
Discussion started by: mohtashims
17 Replies
LEARN ABOUT DEBIAN
ragraph
RAGRAPH(1) General Commands Manual RAGRAPH(1)NAME
ragraph - graph argus(8) data.
COPYRIGHT
Copyright (c) 2000-2003 QoSient. All rights reserved.
SYNOPSIS
ragraph metric [object] [-M mode] [options] [raoptions]
DESCRIPTION
Ragraph reads argus(8) data from an argus-file, and graphs fields of interest from matching argus flow activity records. Current, ragraph
uses rrd-tool to generate GIF formatted graphs, and so many options to rrd-tool are supported by ragraph.
Ragraph supports graphing most metrics that are available in argus data. The list includes bytes, sbytes, dbytes, pkts, spkts, dpkts,
trans, dur, avgdur.
Ragraph also supports graphing based on multiple objects, such as the destination address or destination port values. The list currently
include saddr, daddr, proto, sport, dport.
By default ragraph writes its output to ragraph.gif, in the current directory. Use the '-w' raoption to specify an alternate output file-
name.
OPTIONS -M <mode> -
Specify the mode for printing. Current ragraph supports any arbitrary time range as a mode, specified either as a number followed by
the time scale seconds(s), minutes(m), hours(h), days(d), months(M), years(y), or as a type of time, such as hourly, daily, etc. Exam-
les are:
-M 1s graph bins of size 1 second.
-M 15m graph bins of size 15 minutes.
-M hourly graph bins of size 1 hour.
-M daily graph bins of size 1 day.
-log
Use logarithmic scale for y-axis.
-fill
Turn off area fill.
-stack
Turn off data stacking.
-split
Turn off axis splitting for src/dst(in/out) traffic.
-height
Specify height in pixels for the graph (275 pixels)
-width
Specify width in pixels for the graph (800 pixels)
-upper
Specify upper bounds for graphing data (automatic).
-lower
Specify lower bounds for graphing data (automatic). When data is split, you need to specify the value as a negative number.
-title
Specify a graph title.
RA OPTIONS
Ragraph, like all ra based clients, supports a number of ra options including filtering of input argus records through a terminating filter
expression, and specifying an output filename using the -w option.
See ra(1) for a complete description of ra options.
EXAMPLES
To graph the total load for the data in an argus-file argus.data at 10 second intervals:
ragraph bytes -M 10s -r argus.data -title "Total Load"
To graph the rate (pkt/sec) on a destination port basis for the data from a specific probe in an argus-file argus.data at 1 minute inter-
vals:
ragraph pkts dport -M 1m -r argus.data - srcid 192.168.0.10
AUTHORS
Carter Bullard (carter@qosient.com).
SEE ALSO ragraph(5), ra(1), rarc(5), argus(8)tcpdump(1),
21 July 2001 RAGRAPH(1)