Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Extract a portion of string from each line in Linux Post 303017636 by rkakitapalli on Saturday 19th of May 2018 12:32:39 PM
Old 05-19-2018
This is not the homework/Assignment. This is the backend data from the cloudera manager scheduler(BDR). The first field is the BDR id and the record consists of several other setting but we are concentrating on the BDR id and the destination path. We also changed the paths in compliance with security.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to extract a portion of a string from the whole string

How to extract a portion of a string from a full string using unix. For example: Say source string is = "req92374923.log" I want only the numeric portion of the string say "92374923" how to do that in Unix. (2 Replies)
Discussion started by: ds_sastry
2 Replies

2. Shell Programming and Scripting

extract a portion of log file

hello, I want to grep the log file according to time and get the portion of log from one particular time to other. I can grep for individual lines by time but how should I print lines continuously from given start time till end till given end time. Appreciate your ideas, Thanks chandra (8 Replies)
Discussion started by: chandra004
8 Replies

3. Shell Programming and Scripting

extract date portion from file

Hi, I have a file where there is a date field (single line variable length file) how to extract just the date portion from it the position of date field may vary anywhere in the line but will always have the format mm-dd-yyyy for eg . xxxxxxxxxxxxxxx09-10-2006xxxxxxxxxxxxxxxxxxxx (5 Replies)
Discussion started by: misenkiser
5 Replies

4. Shell Programming and Scripting

how to extract a string value from the given line

Hi I have an input as follows: param1:value1|param2:value2|param3:value3|param4:value4|param5:value5 where, "|" and ":" are delimiters Now suppose, I want to extract the value corresponding to "param4", i.e. "value4" in this case. In case we use awk, I want to use the value in shell... (1 Reply)
Discussion started by: gaurav_1711
1 Replies

5. Shell Programming and Scripting

extract string portion using sed

Hi All I have 3 files as listed below and highlighted in bold the portions of the filenames I need to extract: TOS_TABIN218_20090323.200903231830 TOS_TABIN219_1_20090323.200903231830 TOS_TABIN219_2_20090323.200903231830 I tried source_tabin_name=`echo $fname | sed 's/_.*//'` but I... (6 Replies)
Discussion started by: santam
6 Replies

6. Shell Programming and Scripting

extract string portion from filename using sed

Hi All, I posted something similar before but I now have a another problem. I have filenames as below TOP_TABIN240_20090323.200903231830 TOP_TABIN235_1_20090323.200903231830 i need to extract the dates as in bold. Using bash v 3.xx Im trying to using the print sed command but... (11 Replies)
Discussion started by: santam
11 Replies

7. Shell Programming and Scripting

How to extract a text portion from a file

Can some one help me with shell script to extract a text block between two known strings. The given input file is as below: Name: abs Some tesxt.... Some tesxt.... Some tesxt.... end of text Name: xyz Some tesxt.... Some tesxt.... Some tesxt.... end of text Name: efg Some... (5 Replies)
Discussion started by: ejazs0
5 Replies

8. Shell Programming and Scripting

Extract a string from a line

Hiee all Can anyone tell me how to extract a string from a given line. STAPISDK_RELEASE_32_BL012_2011_JAN_25.1597 I want to extract BL012 from above. as 102 keeps on changing i want smthing like that it extract BL and 102 extrct by its own. Thankx guyzz (9 Replies)
Discussion started by: abhijtr
9 Replies

9. Shell Programming and Scripting

How to extract portion of a string?

Hi Gurus, Would like to seek some help on how to extract a portion of string from log's output as shown below. Sample of raw data: piece handle=/test123/disk_dump/test123/df0_cntrl_PCPFCI20120404_68498 tag=TAG20120404T180035 comment=NONE piece... (13 Replies)
Discussion started by: superHonda123
13 Replies

10. Shell Programming and Scripting

Extract portion of data

Hi Gurus, I need some help in extracting some of these information and massage it into the desired output as shown below. I need to extract the last row with the header in below sample which is usually the most recent date, for example: 2012-06-01 142356 mb 519 -219406 mb 1 ... (9 Replies)
Discussion started by: superHonda123
9 Replies
ospf_monitor(1M)														  ospf_monitor(1M)

NAME
ospf_monitor - monitor OSPF (Open Shortest Path First protocol) gateways SYNOPSIS
mon_db_file DESCRIPTION
Use the command to query OSPF routers. The command operates in interactive mode. It allows the user to query the various OSPF routers to provide detailed information on IO statistics, error logs, link-state data bases, AS external data bases, the OSPF routing table, config- ured OSPF interfaces, and OSPF neighbors. mon_db_file is the complete pathname of a database composed of records configuring destinations for remote commands. Each destination record is a single-line entry which lists the destination IP address, the destination hostname, and an OSPF authentication key (if authen- tication is activated by the destination). Since authentication keys may be present in the destination records, it is recommended that general access to this database be restricted. Refer to RFC-1583 (OSPF Specification, version 2) for details about OSPF database and packet formats. COMMANDS Upon entering interactive mode, presents this prompt: From this prompt, you can enter any of the interactive commands. Interactive commands can be interrupted at any time via a keyboard inter- rupt. Note that the command line length must be less than 200 characters. Local Commands Display all local commands and their functions. Display all remote commands and their functions. Display all configured destinations. This command displays dest_index, the IP address, and the hostname of all potential command destinations configured in mon_db_file. Display the command history buffer showing the last 30 interactive commands. Exit the program. Send remote_command to the same (previous) destination. Send remote_command to configured destination dest_index. Send all output to filename. Send all output to stdout. Remote Commands Display link state advertisement. area_id is the OSPF area for which the query is directed. adv_rtr is the router-id of the router which originated this link state advertisement. type specifies the type of advertisement to request and should be specified as follows: 1 Request the router links advertisements. They describe the collected states of the router's interfaces. For this type of request, the ls_id field should be set to the originating router's Router ID. 2 Request the network links advertisements. They describe the set of routers attached to the network. For this type of request, the ls_id field should be set to the IP interface address of the network's Designated Router. 3 Request the summary link advertisements describing routes to networks. They describe inter-area routes, and enable the con- densing of routing information at area borders. For this type of request, the ls_id field should be set to the destination network's IP address. 4 Request the summary link advertisements describing routes to AS boundary routers. They describe inter-area routes, and enable the condensing of routing information at area borders. For this type of request, the ls_id field should be set to the Router ID of the described AS boundary router. 5 Request the AS external link advertisements. They describe routes to destinations external to the Autonomous System. For this type of request, the ls_id field should be set to the destination network's IP address. Display cumulative log. This log includes input/output statistics for monitor request, hello, data base description, link-state request, link-state update, and link-state ack packets. Area sta- tistics are provided which describe the total number of routing neighbors and number of active OSPF interfaces. Routing table statistics are summarized and reported as the number of intra-area routes, inter-area routes, and AS external data base entries. Display cumulative errors. This log reports the various error conditions which can occur between OSPF routing neighbors and shows the number of occurrences for each. Display the next hop list. This list of valid next hops is mostly derived from the SPF calculation. Display the link-state database (except for ASE's). This table describes the routers and networks making up the AS. If retrans is non-zero, the retransmit list of neighbors held by this lsdb structure will be printed. Display the AS external data base entries. This table reports the advertising router, forwarding address, age, length, sequence number, type, and metric for each AS external route. If retrans is non-zero, the retransmit list of neighbors held by this lsdb structure will be printed. Display the OSPF routing table. This table reports the AS border routes, area border routes, summary AS border routes, networks, summary networks, and AS external networks currently managed via OSPF. If which is omitted, all of the above will be listed. If specified, the value of which (between 1 and 63) specifies that only certain tables should be displayed. The appropriate value is determined by adding up the values for the desired tables from the following list: 1 Routes to AS border routers in this area. 2 Routes to area border routers for this area. 4 Summary routes to AS border routers in other areas. 8 Routes to networks in this area. 16 Summary routes to networks in other areas. 32 AS routes to non-OSPF networks. Display all interfaces. This report shows all interfaces configured for OSPF. Information reported includes the area, interface IP address, interface type, interface state, cost, prior- ity, and the IP address of the DR and BDR for the network. Display all OSPF routing neighbors. Information reported includes the area, local interface address, router ID, neighbor IP address, state, and mode. Display Gated version information. AUTHOR
Rob Coltun of University of Maryland Jeffrey C. Honig of Cornell University SEE ALSO
gated(1M), gdc(1M), ripquery(1M), gated.conf(4). GateD Documentation GateD Configuration Guide ospf_monitor(1M)
All times are GMT -4. The time now is 03:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy