Sponsored Content
Full Discussion: Parse snoop output
Top Forums Shell Programming and Scripting Parse snoop output Post 302430152 by durden_tyler on Wednesday 16th of June 2010 06:55:26 PM
Old 06-16-2010
Thanks, the problem is clearer now.
Try this -

Code:
$ 
$ 
$ cat -n f3
     1    .....$;.GF..POST
     2    /axis/services/
     3    PiContentProvide
     4    r HTTP/1.1..Cont
     5    ent-Type: text/x
     6    ml; charset=UTF-
     7    8..SOAPAction: "
     8    transactio
     9    n"..User-Agent:
    10    Java1.5.0_14..Ho
    11    st: 10.10.14.3
    12    4:50300..Accept:
    13    text/html, imag
    14    e/gif, image/jpe
    15    g, *; q=.2, */*;
    16    q=.2..Connectio
    17    n: Keep-Alive..C
    18    ontent-Length: 7
    19    03....
    20    
    21    
    22    .....$;.GF..<?xm
    23    l version="1.0"
    24    encoding="UTF-8"
    25    ?>.<soapenv:Enve
    26    lope xmlns:soape
    27    nv="http://schem
    28    as.xmlsoap.org/s
    29    oap/envelope/"><
    30    soapenv:Header x
    31    mlns:efet="http:
    32    //sb.airenet/x
    33    sd/RealizarDebito
    34    SemReservaSaldoO
    35    PQRequest"/>
$ 
$ perl -ne 'chomp; if (/^(\.)+\$;.GF/ and $.>1){print "\n\n",$_} elsif (/./){printf} END{print "\n"}' f3
.....$;.GF..POST/axis/services/PiContentProvider HTTP/1.1..Content-Type: text/xml; charset=UTF-8..SOAPAction: "transaction"..User-Agent:Java1.5.0_14..Host: 10.10.14.34:50300..Accept:text/html, image/gif, image/jpeg, *; q=.2, */*;q=.2..Connection: Keep-Alive..Content-Length: 703....

.....$;.GF..<?xml version="1.0"encoding="UTF-8"?>.<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header xmlns:efet="http://sb.airenet/xsd/RealizarDebitoSemReservaSaldoOPQRequest"/>
$ 
$ 

tyler_durden
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

parse through one text file and output many

Hi, everyone The input file pattern is like below: Begin Object1 txt1 end ; Begin Object2 txt2 end ; ... (14 Replies)
Discussion started by: sophiadun
14 Replies

2. Shell Programming and Scripting

Parse Logfile output variable

<SUMMARY filecount_excluded="0" dirbytes_sent="3367893" dirbytes_hashcache="13275664" ..and so on..> <session numthreads="1" type="avtarbackup" ndispatchers="1" ..and so on..><host numprocs="4" speed="900" osuser="root" name="ashsux01" memory="24545" /><build time="11:04:53" msgversion="13-10" ... (11 Replies)
Discussion started by: Ikon
11 Replies

3. Shell Programming and Scripting

Script to capture snoop output

Hi Everyone :), Need your advice as I'm new to UNIX scripting.. I'm trying to write a script to capture snoop output for 5 minutes for every hour for 24 hours. To stop snoop, I need to press Control-C to break it. This is what I got so far, but now I'm stuck! :confused: The script: # cat... (2 Replies)
Discussion started by: faraaris
2 Replies

4. Shell Programming and Scripting

Want to parse output for variables in Bash

Trying to finish up my script that automates some video encoding work. Situation: There is an MKV file to be transcoded. Problem: MKVINFO will give a bunch of output about an MKV file, included in that output are two lines I am interested in: | + Default duration: 41.708ms (23.976 fps... (9 Replies)
Discussion started by: randyharris
9 Replies

5. UNIX for Dummies Questions & Answers

How to parse 2 particular lines from Command output

Hi All, I need help on the following req. I am getting output of a command as follows: 16377612 total memory 3802460 used memory 2827076 active memory 681948 inactive memory 12575152 free memory 477452 buffer memory I want to compute used... (1 Reply)
Discussion started by: mailsara
1 Replies

6. Shell Programming and Scripting

parse output line using bash

hi, i have the followiing scenario where by i am parsing teh following output using cut -d like so #!/bin/bash output="ABCTable| ------------------| | ------------------| code | name | amount |" col1= $output | cut -d'|' -f5 col2= $output | cut -d'|'... (1 Reply)
Discussion started by: nano2
1 Replies

7. Solaris

How to read the output of snoop command?

Hi! I have run the following command: snoop -q -d e1000g0 -o /var/tmp/optima0.txt & them I am trying to read the output of it with snoop -i /var/tmp/optima0.txt, which is giving me this: # snoop -i /var/tmp/optima0.txt | more 1 0.00000 AIOPTSVR -> 10.100.4.72 TCP D=1393 S=22 Push... (8 Replies)
Discussion started by: fretagi
8 Replies

8. Shell Programming and Scripting

awk to parse jil output

Hi , I have a jil file which i am trying to parse and print the job name and the condition corresponding to it. Below is the input file /* -------------------- testjob1 -------------------- */ insert_job: testjob1 job_type: c machine: unix owner: chidori condition: s(joba) and... (9 Replies)
Discussion started by: chidori
9 Replies

9. Shell Programming and Scripting

awk to parse df output

Output of the below code includes unmatched date.Please correct it df -k|awk '$4>50 {print $1, "\t"$4,"\t" $7}' It gives output less than 50% also. (5 Replies)
Discussion started by: vinil
5 Replies

10. Shell Programming and Scripting

Need help to parse iostat command output

Hi, I got the code below is one of the threads from this forum. lineCount=$(iostat | wc -l) numDevices=$(expr $lineCount - 7); iostat $interval -x -t | awk -v awkCpuFile=$cpuFile -v awkDeviceFile=$deviceFile -v awkNumDevices=$numDevices ' BEGIN { print... (2 Replies)
Discussion started by: gopivallabha
2 Replies
Courriel::Header::ContentType(3pm)			User Contributed Perl Documentation			Courriel::Header::ContentType(3pm)

NAME
Courriel::Header::ContentType - The content type for an email part VERSION
version 0.29 SYNOPSIS
my $ct = $part->content_type(); print $ct->mime_type(); print $ct->charset(); my %attr = $ct->attributes(); while ( my ( $k, $v ) = each %attr ) { print "$k => $v "; } DESCRIPTION
This class represents the contents of a "Content-Type" header attached to an email part. Such headers always include a mime type, and may also include additional information such as a charset or other attributes. Here are some typical headers: Content-Type: text/plain; charset=utf-8 Content-Type: multipart/alternative; boundary=abcdefghijk Content-Type: image/jpeg; name="Filename.jpg" API
This class supports the following methods: Courriel::Header::ContentType->new_from_value( ... ) This takes two parameters, "name" and "value". The "name" is optional, and defaults to "Content-Type". The "value" is parsed and split up into the mime type and attributes. Courriel::Header::ContentType->new( ... ) This method creates a new object. It accepts the following parameters: o name This defaults to 'Content-Type'. o value This is the full header value. o mime_type A string like "text/plain" or "multipart/alternative". This is required. o attributes A hash reference of attributes from the header, such as a boundary, charset, etc. The keys are attribute names and the values can either be strings or Courriel::HeaderAttribute objects. Values which are strings will be inflated into objects by the constructor. This is optional, and can be an empty hash reference or omitted entirely. $ct->name() The header name, usually "Content-Type". $ct->value() The raw header value. $ct->mime_type() Returns the mime type value passed to the constructor. However, this value will be in all lower-case, regardless of the original casing passed to the constructor. $ct->charset() Returns the charset for the content type, which will be the value found in the "attributes", if one exists. $ct->attributes() Returns a hash (not a reference) of the attributes passed to the constructor. Attributes are Courriel::HeaderAttribute objects. The keys of the hash are all lower case, though the original casing is preserved in the "name()" returned by the Courriel::HeaderAttribute object. $ct->is_binary() Returns true unless the attachment looks like text data. Currently, this means that is has a charset defined and the charset is not "binary". $ct->attribute($key) Given a key, returns the named Courriel::HeaderAttribute object. Obviously, this value can be "undef" if the attribute doesn't exist. Name lookup is case-insensitive. $ct->attribute_value($key) Given a key, returns the named attribute's value as a string. Obviously, this value can be "undef" if the attribute doesn't exist. Name lookup is case-insensitive. The attribute is a Courriel::HeaderAttribute object. $ct->as_header_value() Returns the object as a string suitable for a header value (but not folded). Note that this uses the original casing of the mime type as passed to the constructor. EXTENDS
This class extends Courriel::Header. ROLES
This class does the Courriel::Role::HeaderWithAttributes role. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT AND LICENSE
This software is Copyright (c) 2012 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) perl v5.14.2 2012-03-07 Courriel::Header::ContentType(3pm)
All times are GMT -4. The time now is 03:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy