Hello All,
I have a file whose data looks something like this
I want to extract just the id, name and city fields in a csv format and sort them by id. Output should look like this.
1,psi,zzz
2,beta,pqr
3,theta,xyz
4,alpha,abc
5,gamma,jkl (12 Replies)
Hi all,
I need to extract lines between the lines 'RD' and 'QA' from a text file (following). there are more that one of such pattern in the file and I need to extract all of them. however, the number of lines between them is varied in the file. Therefore, I can not just use 'grep -A' command.... (6 Replies)
I want to search files (basically .cc files) in /xx folder and subfolders.
Those files (*.cc files) must contain #include "header.h" AND x() function.
I am writing it another way to make it clear,
I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
input file
Desired csv output
gc_type, date/time, milli secs
af, Mar 17 13:09:04 2011, 144.596
af, Mar 20 00:37:37 2011, 144.242
af, ar 20 21:30:59 2011, 108.518
Hi All,
Any help in acheiving the above would be appreciated. I would like to parse through lines within one file and... (5 Replies)
Hello everyone,
ive been trying to replace a string "kw01" in an xml file with the contents of a txt file having multiple lines. im a unix newbie and all the sed combinations i tried resulted to being garbled. Below is the contents of the txt file:
RAISEDATTIME
--------------------... (13 Replies)
Hi Fellows,
I have been struggling to fix an issue in csv records to compose sql statements and have been really losing sleep over it. Here is the problem:
I have csv files in the following pipe-delimited format:
Column1|Column2|Column3|Column4|NEWLINE
Address Type|some descriptive... (4 Replies)
I am trying to extract multiple strings from snmp-mib files like below.
-----
$ cat IF-MIB.mib
<snip>
linkDown NOTIFICATION-TYPE
OBJECTS { ifIndex, ifAdminStatus, ifOperStatus }
STATUS current
DESCRIPTION
"A linkDown trap signifies that the SNMP entity, acting in... (5 Replies)
I have a file that has some lines starts with *
I want to get these lines, then get the word between "diac" and "lex".
ex.
file:
;;WORD AlAx
*0.942490 diac:Al>ax lex:>ax_1 bw:Al/DET+>ax/NOUN+ gloss:brother pos:noun prc3:0 prc2:0 prc1:0 prc0:Al_det per:na asp:na vox:na mod:na gen:m num:s... (4 Replies)
Hi
I have a txt file and I would like to use egrep without using -v option to exclude the lines which matches with multiple Strings.
Let's say I have some text in the txt file. The command should not fetch lines if they have strings something like
CAT MAT DAT
The command should fetch me... (4 Replies)
Hello,
I have spent considerable amount of time breaking my head on this and reached out here. here is the back ground.
OS - Solaris 10
There are two strings '<Orin>sop' and '<Dup>two' which I wanted to look for in a file without the quotes on different lines and ONLY if both strings are... (5 Replies)
Discussion started by: keithTait309875
5 Replies
LEARN ABOUT CENTOS
log2pcap
LOG2PCAP(1) User Commands LOG2PCAP(1)NAME
log2pcap - Extract network traces from Samba log files
SYNOPSIS
log2pcap [-h] [-q] [logfile] [pcap_file]
DESCRIPTION
This tool is part of the samba(7) suite.
log2pcap reads in a samba log file and generates a pcap file (readable by most sniffers, such as ethereal or tcpdump) based on the packet
dumps in the log file.
The log file must have a log level of at least 5 to get the SMB header/parameters right, 10 to get the first 512 data bytes of the packet
and 50 to get the whole packet.
OPTIONS -h
If this parameter is specified the output file will be a hex dump, in a format that is readable by the text2pcap utility.
-q
Be quiet. No warning messages about missing or incomplete data will be given.
logfile
Samba log file. log2pcap will try to read the log from stdin if the log file is not specified.
pcap_file
Name of the output file to write the pcap (or hexdump) data to. If this argument is not specified, output data will be written to
stdout.
-?|--help
Print a summary of command line options.
EXAMPLES
Extract all network traffic from all samba log files:
$ log2pcap < /var/log/* > trace.pcap
Convert to pcap using text2pcap:
$ log2pcap -h samba.log | text2pcap -T 139,139 - trace.pcap
VERSION
This man page is correct for version 3 of the Samba suite.
BUGS
Only SMB data is extracted from the samba logs, no LDAP, NetBIOS lookup or other data.
The generated TCP and IP headers don't contain a valid checksum.
SEE ALSO text2pcap(1), ethereal(1)AUTHOR
The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open
Source project similar to the way the Linux kernel is developed.
This manpage was written by Jelmer Vernooij.
Samba 4.0 06/17/2014 LOG2PCAP(1)