Sponsored Content
Top Forums Shell Programming and Scripting Parsing a log file to cut off some parts Post 302989433 by Chrismcq on Thursday 12th of January 2017 11:34:37 AM
Old 01-12-2017
Wrench

Hi - I may be missing the point here, but if it is only the first update line that you are interested in, you could simply do the following :-

grep "Update completed" MyLogFile | head -1
Is this any good to you.
This User Gave Thanks to Chrismcq For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing a Log file

Hi All, I'm deffently not a Unix specialist so be Gentel. I need to parse a Log file that looks like that: 2006-06-12 01:00:00,463 ERROR {cleanLoggersFiles} General Error comverse.compas.shared.exceptions.SystemParametersException: Error in reading parameter FileLocation at... (4 Replies)
Discussion started by: tbirenzweig
4 Replies

2. Shell Programming and Scripting

Parsing textfile problem with cut

Hi, I have a textfile with several lines like this: text num: USER text (num) num num I need all these stuff. Problem is, how to get these stuff after ":". USER is a username and all chars are possible, even whitespace. So I cant use cut. Any ideas? (3 Replies)
Discussion started by: mcW
3 Replies

3. UNIX for Dummies Questions & Answers

parsing a log file

I need help in parsing the following log files. 10 Apr 2009 0:16:16 * name: Tuna Belly Format: Well done, Price: 999 only 10 Apr 2009 0:16:16 * name: Roast Beef Format: Raw, Price: 55 c 10 Apr 2009 0:16:16 * name: Pasta Format: Dry, Price: 88.43 only etcetc I need to parse this... (8 Replies)
Discussion started by: izuma
8 Replies

4. UNIX for Dummies Questions & Answers

How to cut a string in two parts and show the other part

hi everybody.. I have a string like : abcd:efgh xxyy:yyxx ssddf:kjlioi ghtyu:jkksk nhjkk:heuiiue please tell me how i can display only the characters after ":" in the output the output should be : efgh yyxx kjlioi jkksk heuiiue please give quick reply.. its urgent..!! (6 Replies)
Discussion started by: adityamitra
6 Replies

5. Shell Programming and Scripting

Help Parsing a Log File

Hello all, I am new to scripting and I have written a script that performs an Rsync on my NAS and then moves on to send me an email with the status etc. The problem is that I think Rsync is taking to long to complete and the IF statement is timing out, as it doesn't appear to move on. Here... (1 Reply)
Discussion started by: Mongrel
1 Replies

6. Shell Programming and Scripting

Cut the path into two parts

Hi, file=/usr/lib I need to cut and put it into two variable like string1=/usr string2=lib I made it for string2 string2=${file#/*/} How to get String1 in the same way which I have get string2. Use even more code tags ;) (4 Replies)
Discussion started by: munna_dude
4 Replies

7. Shell Programming and Scripting

Parsing Log File help

Hi, I am a newbie to scripting. I have multiple log files (saved as .gz) in a directory that looks like this 01-01-2013 10:00 pn: 123 01-01-2013 10:00 sn: 987 01-01-2013 10:00 Test1 01-01-2013 10:00 Result: Pass 01-01-2013 10:00 Time: 5:00 01-01-2013 10:00 Test2 01-01-2013 10:00... (3 Replies)
Discussion started by: linuxnew
3 Replies

8. Shell Programming and Scripting

Incrementing parts of ten digits number by parts

I have number in file which contains date and serial number: 2013101000. The last two digits are serial number (00). So maximum of serial number is 100. After reaching 100 it becomes 00 with incrementing 10 which is day with max 31. after reaching 31 it becomes 00 and increments 10... (31 Replies)
Discussion started by: Natalie
31 Replies

9. Shell Programming and Scripting

HELP on parsing this log file

Hi, I have a log file that looks like below and I am wanting to know if there is a better way of parsing it from how I am doing it right now. I am looking for when an application service is OFFLINE and ONLINE. This log file is getting written into every 30 minutes ... (1 Reply)
Discussion started by: newbie_01
1 Replies

10. Shell Programming and Scripting

Getting various parts from the log

I am dealing with some app log, see example below: 22:16:13.601 ClientSession(905)--Connection(5)--SELECT GETDATE() 22:16:13.632 ClientSession(158)--Connection(5)--SELECT 1 22:16:13.632 ClientSession(848)--Connection(6735)--SELECT 1 So far I needed to collect certain column from it, such as... (3 Replies)
Discussion started by: migurus
3 Replies
Net::DNS::Update(3)					User Contributed Perl Documentation				       Net::DNS::Update(3)

NAME
Net::DNS::Update - Create a DNS update packet SYNOPSIS
use Net::DNS; $update = new Net::DNS::Update( 'example.com', 'IN' ); $update->push( prereq => nxrrset('foo.example.com. A') ); $update->push( update => rr_add('foo.example.com. 86400 A 192.168.1.2') ); DESCRIPTION
Net::DNS::Update is a subclass of Net::DNS::Packet, to be used for making DNS dynamic updates. Programmers should refer to RFC2136 for dynamic update semantics. WARNING: This code is still under development. Please use with caution on production nameservers. METHODS
new $update = new Net::DNS::Update; $update = new Net::DNS::Update( 'example.com' ); $update = new Net::DNS::Update( 'example.com', 'HS' ); Returns a Net::DNS::Update object suitable for performing a DNS dynamic update. Specifically, it creates a packet with the header opcode set to UPDATE and the zone record type to SOA (per RFC 2136, Section 2.3). Programs must use the push() method to add RRs to the prerequisite, update, and additional sections before performing the update. Arguments are the zone name and the class. If the zone is omitted, the default domain will be taken from the resolver configuration. If the class is omitted, it defaults to IN. EXAMPLES
The first example below shows a complete program; subsequent examples show only the creation of the update packet . Add a new host #!/usr/bin/perl use Net::DNS; # Create the update packet. my $update = new Net::DNS::Update('example.com'); # Prerequisite is that no A records exist for the name. $update->push( pre => nxrrset('foo.example.com. A') ); # Add two A records for the name. $update->push( update => rr_add('foo.example.com. 86400 A 192.168.1.2') ); $update->push( update => rr_add('foo.example.com. 86400 A 172.16.3.4') ); # Send the update to the zone's primary master. my $resolver = new Net::DNS::Resolver; $resolver->nameservers('primary-master.example.com'); my $reply = $resolver->send($update); # Did it work? if ($reply) { if ( $reply->header->rcode eq 'NOERROR' ) { print "Update succeeded "; } else { print 'Update failed: ', $reply->header->rcode, " "; } } else { print 'Update failed: ', $resolver->errorstring, " "; } Add an MX record for a name that already exists my $update = new Net::DNS::Update('example.com'); $update->push( prereq => yxdomain('example.com') ); $update->push( update => rr_add('example.com MX 10 mailhost.example.com') ); Add a TXT record for a name that doesn't exist my $update = new Net::DNS::Update('example.com'); $update->push( prereq => nxdomain('info.example.com') ); $update->push( update => rr_add('info.example.com TXT "yabba dabba doo"') ); Delete all A records for a name my $update = new Net::DNS::Update('example.com'); $update->push( prereq => yxrrset('foo.example.com A') ); $update->push( update => rr_del('foo.example.com A') ); Delete all RRs for a name my $update = new Net::DNS::Update('example.com'); $update->push( prereq => yxdomain('byebye.example.com') ); $update->push( update => rr_del('byebye.example.com') ); Perform a DNS update signed using a BIND key file my $update = new Net::DNS::Update('example.com'); $update->push( update => rr_add('foo.example.com A 10.1.2.3') ); $update->push( update => rr_add('bar.example.com A 10.4.5.6') ); $update->sign_tsig( "$dir/Khmac-sha512.example.com.+165+01018.private" ); The corresponding public key file may also be used: $update->sign_tsig( "$dir/Khmac-sha512.example.com.+165+01018.key" ); Another way to perform a signed update my $key_name = 'tsig-key'; my $key = 'awwLOtRfpGE+rRKF2+DEiw=='; my $update = new Net::DNS::Update('example.com'); $update->push( update => rr_add('foo.example.com A 10.1.2.3') ); $update->push( update => rr_add('bar.example.com A 10.4.5.6') ); $update->sign_tsig( $key_name, $key ); Perform a signed update with a customized TSIG record my $key_name = 'tsig-key'; my $key = 'awwLOtRfpGE+rRKF2+DEiw=='; my $tsig = new Net::DNS::RR("$key_name TSIG $key"); $tsig->fudge(60); my $update = new Net::DNS::Update('example.com'); $update->push( update => rr_add('foo.example.com A 10.1.2.3') ); $update->push( update => rr_add('bar.example.com A 10.4.5.6') ); $update->push( additional => $tsig ); BUGS
This code is still under development. Please use with caution on production nameservers. COPYRIGHT
Copyright (c) 1997-2002 Michael Fuhr. Portions Copyright (c) 2002-2004 Chris Reinhardt. All rights reserved. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
perl, Net::DNS, Net::DNS::Packet, Net::DNS::Header, Net::DNS::RR, Net::DNS::Resolver, RFC 2136, RFC 2845 perl v5.18.2 2014-01-16 Net::DNS::Update(3)
All times are GMT -4. The time now is 01:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy