Sponsored Content
Top Forums Shell Programming and Scripting need help in search the error messages from log file Post 302601667 by pjlotiya on Friday 24th of February 2012 06:34:29 AM
Old 02-24-2012
---Updated below---

Last edited by pjlotiya; 02-24-2012 at 08:10 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

search log file

hi, I know this question probably been asked a thousand times but I can't find any posts that can help me out, so here I am. The problem is at the end of the day I want to execute a script but I only want to invoke it if and only if scripts 1/2/3/4/5/6 executed successfully. So what I did is to... (1 Reply)
Discussion started by: mpang_
1 Replies

2. Shell Programming and Scripting

String search in log file

Hi all! I have a log file from an incremental backup. This next script I've done works when the backup completes in the same day it started. But if the backup goes on to the next day, this one doesn't work anymore. ################################## #VARS data=`date '+%m/%d/%y'`... (1 Reply)
Discussion started by: sliver
1 Replies

3. HP-UX

How to Redirect the error messages from Syslog file to our own Application Log File

Hello, I am New to Unix. I am Using HP-UX 9000 Series for my Application. I am Currently Facing an Issue that the error messages are being written in the syslog file instead of the Application Log File. The Codes for that Syslog.h is written in Pro*C. I want to know how to Redirect these... (3 Replies)
Discussion started by: balasubramaniam
3 Replies

4. Shell Programming and Scripting

Appending error messages from log file next to the corresponding error record

Hi Everyone, I have an issue and trying to get a solution but was not succesful yet. Any help is greatly appreciated. I am using ksh to inoke sql loader to load data from txt file into two oracle tables based on the condition written in the control file. If an error occurs while loading into... (8 Replies)
Discussion started by: vpv0002
8 Replies

5. Shell Programming and Scripting

Search a pattern in a log file

I have file which gets updated every minute/second. Is it possible in shell scripting that I can search for some pattern infinitely in this file and if it finds that pattern, alert the user. A sample of log file is below. The following file is getting updated every second. I want to alert the... (2 Replies)
Discussion started by: Tuxidow
2 Replies

6. UNIX for Dummies Questions & Answers

How to search in a log file?

Hey guys, I'm still relatively new to Linux and everyday is a learning experience for me. Anyway, I have a question about searching inside a log file and didn't know what topic this would come under so posting it here as I am a Dummie lol! Say I have a log file which consists of say, for... (2 Replies)
Discussion started by: jimbob01
2 Replies

7. Red Hat

monitoring search strings /var/log/messages

Hello Everyone, I am setting up monitoring system for linux server, I need to add few some common error message in monitoring file which can search those strings in /var/log/messages file on the client. can someone suggest few error messages. Thanks, (2 Replies)
Discussion started by: bobby320
2 Replies

8. Shell Programming and Scripting

How to search log file from a date

Hi All, I want to grep through all the log files created from 20th August. How do I do that? My script will run everyday. So it will take current date as To_Date. My log file name looks like - applog-2012-08-20-000001....applog-2012-08-20-000002...etc. Thanks in advance. (5 Replies)
Discussion started by: kmajumder
5 Replies

9. SuSE

Some error messages in var/log/messages

How are you? SUSE V10 and 11. In /var/log/messages I see these lines in some servers. I'd like to know what causes these errors and how to fix them. Thank you, error: PAM: Authentication failure for root from XXXXXXXX Did not receive identification string from XXXXXXX Invalid user suse-gm... (2 Replies)
Discussion started by: JDBA
2 Replies

10. UNIX for Dummies Questions & Answers

Search special characters in a file and replace with meaningful text messages like Hello

Search special characters in a file and replace with meaningful text messages like Hello (2 Replies)
Discussion started by: raka_rjit
2 Replies
MONGODBDRIVERBULKWRITE(3)						 1						 MONGODBDRIVERBULKWRITE(3)

The MongoDBDriverBulkWrite class

INTRODUCTION
The MongoDBDriverBulkWrite collects one ore more write operations that should be sent to the server in writees. The MongoDBDriverManager has 3 wrapper methods for single-item writees for simplicity: o MongoDBDriverManager::executeInsert o MongoDBDriverManager::executeDelete o MongoDBDriverManager::executeUpdate along with the main method to execute a write: MongoDBDriverManager::executeBulkWrite When constructing a write, you must define if the write should be executed in order (default), or if it can be reordered by the server. Ordered write write operations are sent to the server, in the order provided, for serial execution. If a write fails, any remaining opera- tions will be aborted. Unordered operations are sent to the server in arbitrary order where they may be executed in parallel. Any errors that occur are reported after all operations have been attempted. CLASS SYNOPSIS
MongoDB0 final MongoDB0ntable Methods o public MongoDBDriverBulkWrite::__construct ([boolean $ordered = true]) o public int MongoDBDriverBulkWrite::count (void ) o public void MongoDBDriverBulkWrite::delete (array|object $filter, [array $deleteOptions]) o public MongoDBDriverObjectID MongoDBDriverBulkWrite::insert (array|object $document) o public void MongoDBDriverBulkWrite::update (array|object $filter, array|object $newObj, [array $updateOptions]) EXAMPLES
Example #1 Mixed write operations sent in groupped writees Mixing write operations (insert/update/delete) will create internal sub-writees and will be sent sequentially to the server. <?php $write = new MongoDBDriverBulkWrite(true); $write->insert($a); $write->update($b, $obj); $write->update($c, $obj); $write->insert($d); $write->insert($e); $write->delete($f); ?> Will result in 4 writes (round-trips) being executed. Example #2 Ordered BulkWrite causing error <?php $write = new MongoDBDriverBulkWrite(false); $write->delete([]); $write->insert(["_id" => 1]); $write->insert(["_id" => 2]); $write->insert(["_id" => 3, "hello" => "world"]); $write->update(["_id" => 3], ['$set' => ["hello" => "earth"]]); $write->insert(["_id" => 4, "hello" => "pluto"]); $write->update(["_id" => 4], ['$set' => ["hello" => "moon"]]); $write->insert(["_id" => 3]); $write->insert(["_id" => 4]); $write->insert(["_id" => 5]); $manager = new MongoDBDriverManager("mongodb://localhost:27017"); $writeConcern = new MongoDBDriverWriteConcern(MongoDBDriverWriteConcern::MAJORITY, 1000); try { $result = $manager->executeBulkWrite("databaseName.collectionName", $write, $writeConcern); } catch(MongoDBDriverDuplicateKeyException $ex) { $result = $ex->getWriteResult(); printf("Inserted %d document(s) ", $result->getInsertedCount()); printf("Updated %d document(s) ", $result->getModifiedCount()); /* If the WriteConcern could not be fullfilled */ if ($writeConcernError = $result->getWriteConcernError()) { printf("%s (%d): %s ", $writeConcernError->getMessage(), $writeConcernError->getCode(), var_export($writeConcernError->getInfo(), true) ); } /* If the write could not happen at all */ foreach ($result->getWriteErrors() as $writeError) { printf("Operation#%d: %s (%d) ", $writeError->getIndex(), $writeError->getMessage(), $writeError->getCode() ); } } catch(MongoDBDriverAuthenticationException $ex) { } catch(MongoDBDriverConnectionException $ex) { } catch(MongoDBDriverRuntimeException $ex) { } ?> The above example will output: Inserted 4 document(s) Updated 2 document(s) Operation#7: E11000 duplicate key error index: databaseName.collectionName.$_id_ dup key: { : 3 } (11000) If the WriteConcern could not be fullfilled, the example above would output something like: Inserted 4 document(s) Updated 2 document(s) waiting for replication timed out (64): array ( 'wtimeout' => true, ) Operation#7: E11000 duplicate key error index: databaseName.collectionName.$_id_ dup key: { : 3 } (11000) Executing the same example, changing the order to false: <?php $write = new MongoDBDriverBulkWrite(false); /* ... */ ?> The above example will output: Inserted 5 document(s) Updated 2 document(s) Operation#7: E11000 duplicate key error index: databaseName.collectionName.$_id_ dup key: { : 3 } (11000) Operation#8: E11000 duplicate key error index: databaseName.collectionName.$_id_ dup key: { : 4 } (11000) SEE ALSO
o MongoDBDriverManager::executeBulkWrite oMongoDBDriverWriteResult oMongoDBDriverWriteConcern oMongoDBDriverWriteConcernError oMongoDBDriverWriteError PHP Documentation Group MONGODBDRIVERBULKWRITE(3)
All times are GMT -4. The time now is 10:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy