Sponsored Content
Top Forums UNIX for Dummies Questions & Answers String extraction from log file Post 302900728 by Dip on Thursday 8th of May 2014 11:50:21 AM
Old 05-08-2014
String extraction from log file

Hi,

Log file will contain text like below:

Code:
May 7 14:12:09 nap_fujitsu-nexus_pbb-denek-01-r_DE.de.ignite.net 108767: 115673: May 7 14:12:08: %RTT-3-IPSLATHRESHOLD: IP SLA Monitor(112): Threshold below for rtt
May 8 14:12:09 nap_fujitsu-nexus_pbb-denek-01-r_DE.de.ignite.net 108767: 115673: May 7 14:12:08: %RTT-3-IPSLATHRESHOLD: IP SLA Monitor(112): Threshold below for rtt
May 9 14:12:09 nap_fujitsu-nexus_pbb-denek-01-r_DE.de.ignite.net 108767: 115673: May 7 14:12:08: %RTT-3-IPSLATHRESHOLD: IP SLA Monitor(112): Threshold below for rtt
May 10 14:12:09 nap_fujitsu-nexus_pbb-denek-01-r_DE.de.ignite.net 108767: 115673: May 7 14:12:08: %RTT-3-IPSLATHRESHOLD: IP SLA Monitor(112): Threshold below for rtt

I need to extract the number "IP SLA Monitor(112):" between this text. So here the command should return "112".

Could you please help me with the command?

Last edited by vgersh99; 05-08-2014 at 12:56 PM.. Reason: code tags, please!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

String extraction from user input - sh

Hi, I have a shell script to build components of a product. The follow snippet will explain what I am doing. # !/bin/sh for choice in "$@" ; do case $choice in "o") echo "Calling $choice" ; o ;; "i") echo... (8 Replies)
Discussion started by: vino
8 Replies

2. Shell Programming and Scripting

Extraction of string from Stringlist using delimiter

Hi Experts, I need to extract some set of strings one be one using delimiter. Example: shellscript.sh|unix.sh|script_file.sh i need to extract this shellscript.sh,unix.sh,script_file.sh separately. I tried but couldn't get. Please help me.. Thanks & Regards :), Kanda (3 Replies)
Discussion started by: spkandy
3 Replies

3. Shell Programming and Scripting

nasty string extraction problem

Hello, if I have a file containing a chunk of HTML and I want to extract always the string beginning http://www.xxx.com/v/ that ends just before "> (i.e. and including the bit BqqtJpfZElQ&hl will change randomly) Any ideas??? # cat randomfeature.html <object width="160"... (3 Replies)
Discussion started by: kevinyeandel1
3 Replies

4. Shell Programming and Scripting

Extraction of the output from a string.

Hi Everyone, I stored the result of a certain awk script in the variable arr.The result is /inets /banking /tools. arr= /inets /banking /tools These are 3 direcctories. I should be able to move in to these directories using "cd" command.Can you tell me how to extract... (5 Replies)
Discussion started by: saicharantej
5 Replies

5. UNIX for Dummies Questions & Answers

String extraction from a text file

The following script code works great for extracting 'postmaster' from a line of text stored in a variable named string: string="PenaltyError:=554 5.7.1 Error, send your mail to postmaster@LOCALDOMAIN" stuff=$( echo $string | cut -d@ -f1 | awk '{ print $NF }' ) echo $stuff However, I need to be... (9 Replies)
Discussion started by: cleanden
9 Replies

6. Shell Programming and Scripting

Need help in string extraction using regular expressions

Hi, I am a new bee to this forum. I am trying to extract the text after a matching pattern from a url using regular expression. Ex: http://locatlhost:2020/proxy/checkthisout I want to extract the string after proxy/. I am not familiar with reg ex. Can someone please help? (2 Replies)
Discussion started by: akatraga
2 Replies

7. Shell Programming and Scripting

String Extraction in Perl

I have a string stored in a variable. For instance, $str = " Opcode called is : CM_OP_xxx " where xxx changes dynamically and can be either LOGIN or SEARCH..... depends on runtime. For example : $str = " Opcode called is : CM_OP_SEARCH " $str = " Opcode called is : CM_OP_LOGIN " I... (3 Replies)
Discussion started by: vkca
3 Replies

8. Shell Programming and Scripting

Sub-string extraction on arrays

Hi, I'm trying to extract the middle of an array that is of variable length but always has a first and last common element, The following works OK... #!/bin/bash ARRAY='switch' ARRAY='option1' ARRAY='option2' ARRAY='option3' ARRAY='value' SWITCH=${ARRAY:0:1} VALUE=${ARRAY:(-1)}... (1 Reply)
Discussion started by: ASGR
1 Replies

9. Solaris

string extraction won't work. Why?

#!/usr/bin/ksh set -x testfile=my.test.file.flag echo ${testfile: (-4)} #/home/maldohe/scripts/spawn1& sleep 3 echo myspawn is now ending exit Background: I am trying to extract the word flag from anf given file name. This is a demo script that I am working on to fix a production issue.... (8 Replies)
Discussion started by: Harleyrci
8 Replies

10. Shell Programming and Scripting

String Extraction

I am trying to extract a time from the below string in perl but not able to get the time properly I just want to extract the time from the above line I am using the below syntax x=~ /(.*) (\d+)\:(\d+)\:(\d+),(.*)\.com/ $time = $2 . ':' . $3 . ':' . $4; print $time Can... (1 Reply)
Discussion started by: karan8810
1 Replies
H_ERTT(4)						   BSD Kernel Interfaces Manual 						 H_ERTT(4)

NAME
h_ertt -- Enhanced Round Trip Time Khelp module SYNOPSIS
#include <netinet/khelp/h_ertt.h> DESCRIPTION
The h_ertt Khelp module works within the khelp(9) framework to provide TCP with a per-connection, low noise estimate of the instantaneous RTT. The implementation attempts to be robust in the face of delayed acknowledgements, TCP Segmentation Offload (TSO), receivers who manipu- late TCP timestamps and lack of the TCP timestamp option altogether. TCP receivers using delayed acknowledgements either acknowledge every second packet (reflecting the time stamp of the first) or use a timeout to trigger the acknowledgement if no second packet arrives. If the heuristic used by h_ertt determines that the receiver is using delayed acknowledgements, it measures the RTT using the second packet (the one that triggers the acknowledgement). It does not measure the RTT if the acknowledgement is for the first packet, since it cannot be accurately determined. When TSO is in use, h_ertt will momentarily disable TSO whilst marking a packet to use for a new measurement. The process has negligible impact on the connection. h_ertt associates the following struct with each connection's TCP control block: struct ertt { TAILQ_HEAD(txseginfo_head, txseginfo) txsegi_q; /* Private. */ long bytes_tx_in_rtt; /* Private. */ long bytes_tx_in_marked_rtt; unsigned long marked_snd_cwnd; int rtt; int maxrtt; int minrtt; int dlyack_rx; /* Private. */ int timestamp_errors; /* Private. */ int markedpkt_rtt; /* Private. */ uint32_t flags; }; The fields marked as private should not be manipulated by any code outside of the h_ertt implementation. The non-private fields provide the following data: bytes_tx_in_marked_rtt The number of bytes transmitted in the markedpkt_rtt. marked_snd_cwnd The value of cwnd for the marked rtt measurement. rtt The most recent RTT measurement. maxrtt The longest RTT measurement that has been taken. minrtt The shortest RTT measurement that has been taken. flags The ERTT_NEW_MEASUREMENT flag will be set by the implementation when a new measurement is available. It is the responsibility of h_ertt consumers to unset the flag if they wish to use it as a notification method for new measurements. SEE ALSO
cc_chd(4), cc_hd(4), cc_vegas(4), mod_cc(4), hhook(9), khelp(9) ACKNOWLEDGEMENTS
Development and testing of this software were made possible in part by grants from the FreeBSD Foundation and Cisco University Research Pro- gram Fund at Community Foundation Silicon Valley. HISTORY
The h_ertt module first appeared in FreeBSD 9.0. The module was first released in 2010 by David Hayes whilst working on the NewTCP research project at Swinburne University of Technology's Centre for Advanced Internet Architectures, Melbourne, Australia. More details are available at: http://caia.swin.edu.au/urp/newtcp/ AUTHORS
The h_ertt Khelp module and this manual page were written by David Hayes <david.hayes@ieee.org>. BUGS
The module maintains enhanced RTT estimates for all new TCP connections created after the time at which the module was loaded. It might be beneficial to see if it is possible to have the module only affect connections which actually care about ERTT estimates. BSD
January 18, 2012 BSD
All times are GMT -4. The time now is 07:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy