Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Need help with a tail and a grep Post 302402643 by joeyg on Wednesday 10th of March 2010 09:10:12 AM
Old 03-10-2010
Tools

something like:

Code:
tail myfile.txt | grep -e "value1" -e "value2"

which would look to last 10 lines of file, and select any records with "value1" or "value2" present.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with tail /grep needed

Hello: I'm a very newbee at UNIX/AIX. What i want to do is to tail a file from the bottom until a certain string is found and write all the lines after the found string to another file. I've tried out a lot of combination with tail and grep but doesn't find the good one. Could someone help... (4 Replies)
Discussion started by: Felix2511
4 Replies

2. Shell Programming and Scripting

tail, grep and cut

Hello all, I have some weird problem that kinda baffles me. Say I have the following test file: claudia:~/tmp$ cat testfile.txt This is a test line This is the second test line And yeah, this is the third test line Then say I want to tail the file, grep for the word "third" then... (7 Replies)
Discussion started by: sylaan
7 Replies

3. Shell Programming and Scripting

tail | grep lagging badly

I'm trying to use tail/grep to monitor a log file. The command I cooked up is: tail -n 50 -f output.log | grep 'type:system' | cut -f 5- A sample line from the log file is: 1208894862 type:system session:0 severity:4 load started the columns are tab delimited. this works ok, except... (3 Replies)
Discussion started by: WasabiVengeance
3 Replies

4. Shell Programming and Scripting

Grep or Tail in shell script

Hi, I am writing a shell script that checks catalina logs on a production system and mails me if it detects errors. It greps the logs for known errors which i have defined as variables. The problem is the logs are huge, approx 30,000 before they rotate. So I am forced to use grep instead... (3 Replies)
Discussion started by: Moxy
3 Replies

5. Shell Programming and Scripting

tail | grep

The program that is running on my machine generates log files. I want to be able to know the number of lines that contain "FT" in the most recent log file. I wrote the following, but it always returns zero. And I know the count is not zero. Any ideas? ls -rt *.log | tail -n 1 | grep -c FT (6 Replies)
Discussion started by: sdilucca
6 Replies

6. UNIX for Dummies Questions & Answers

mulitple grep using tail

I have a basic tail/grep question. I have logs that are generated & kept in a directory called alert_audit. I am using "tail" to see the logs that are coming in, but I only need logs that contain the IP address 10.249.185. or 10.247.231. Here is the command I have, but it pulls all IP... (3 Replies)
Discussion started by: robertson1995
3 Replies

7. UNIX for Dummies Questions & Answers

Write to file using tail -f through a pipe to grep

Hi -- I'm looking to write to a file after piping output from tail -f through to grep: #write to a file for all lines with "searchtext" within in error_log: Expand|Select|Wrap|Line Numbers tail -f /var/error_log | grep searchtext > output.txt The above command... (2 Replies)
Discussion started by: ndedhia1
2 Replies

8. Shell Programming and Scripting

How do i use tail & grep in real time here??

Hi I have a file which is updated very frequently. Where in i wanted to use tail -f command in the script and wanted to grep for a particular word. But the issue is when i use tail -f filename|grep "word" ... it will show me blank until the word is found in the real time. if it shows... (13 Replies)
Discussion started by: nikhil jain
13 Replies

9. UNIX for Dummies Questions & Answers

Tail -f | grep > output.txt

hi guys, I perform a sort of monitoring. I have a server running and with tail -f | grep "Searchstring"I monitor the log-file for recent specific entries. This is ok and works fine. Now, in addition I want to have my search results not posted into the shell but into a file. I tried: tail... (3 Replies)
Discussion started by: LaUs3r
3 Replies

10. Shell Programming and Scripting

Trouble with tail and grep

Good Morning, i ran into some trouble this morning while 'improving' my monitoring stuff. i would like to get a warning when the number of mails sent (outbound) by postfix is above a certain number. so far, so easy. to test that i simply put cat /var/log/mail.info | grep 'to=<' | grep -v -e... (1 Reply)
Discussion started by: Mike
1 Replies
SLAPD.REPLOG(5) 						File Formats Manual						   SLAPD.REPLOG(5)

NAME
slapd.replog - slapd replication log format SYNOPSIS
slapd.replog slapd.replog.lock DESCRIPTION
The file slapd.replog is produced by the stand-alone LDAP daemon, slapd, when changes are made to its local database that are to be propa- gated to one or more replica slapds. The file consists of zero or more records, each one corresponding to a change, addition, or deletion from the slapd database. The file is meant to be read and processed by slurpd, the stand-alone LDAP update replication daemon. The records are separated by a blank line. Each record has the following format. The record begins with one or more lines indicating the replicas to which the change is to be propagated: replica: <hostname[:portnumber]> Next, the time the change took place given, as the number of seconds since 00:00:00 GMT, Jan. 1, 1970, with an optional decimal extension, in order to make times unique. Note that slapd does not make times unique, but slurpd makes all times unique in its copies of the replog files. time: <integer[.integer]> Next, the distinguished name of the entry being changed is given: dn: <distinguishedname> Next, the type of change being made is given: changetype: <[modify|add|delete|modrdn]> Finally, the change information itself is given, the format of which depends on what kind of change was specified above. For a changetype of modify, the format is one or more of the following: add: <attributetype> <attributetype>: <value1> <attributetype>: <value2> ... - Or, for a replace modification: replace: <attributetype> <attributetype>: <value1> <attributetype>: <value2> ... - Or, for a delete modification: delete: <attributetype> <attributetype>: <value1> <attributetype>: <value2> ... - If no attributetype lines are given, the entire attribute is to be deleted. For a changetype of add, the format is: <attributetype1>: <value1> <attributetype1>: <value2> ... <attributetypeN>: <value1> <attributetypeN>: <value2> For a changetype of modrdn, the format is: newrdn: <newrdn> deleteoldrdn: 0 | 1 where a value of 1 for deleteoldrdn means to delete the values forming the old rdn from the entry, and a value of 0 means to leave the val- ues as non-distinguished attributes in the entry. For a changetype of delete, no additional information is needed in the record. The format of the values is the LDAP Directory Interchange Format described in ldif(5). Access to the slapd.replog file is synchronized through the use of flock(3) on the file slapd.replog.lock. Any process reading or writing this file should obey this locking convention. EXAMPLE
The following sample slapd.replog file contains information on one of each type of change. replica: truelies.rs.itd.umich.edu replica: judgmentday.rs.itd.umich.edu time: 797612941 dn: cn=Babs Jensen, o=U of M, c=US changetype: add objectclass: person cn: babs cn: babs jensen sn: jensen replica: truelies.rs.itd.umich.edu replica: judgmentday.rs.itd.umich.edu time: 797612973 dn: cn=Babs Jensen, o=U of M, c=US changetype: modify add: description description: the fabulous babs replica: truelies.rs.itd.umich.edu replica: judgmentday.rs.itd.umich.edu time: 797613020 dn: cn=Babs Jensen, o=U of M, c=US changetype: modrdn newrdn: cn=Barbara J Jensen deleteoldrdn: 0 FILES
slapd.replog slapd.replog.lock SEE ALSO
ldap(3), ldif(5), slapd(8), slurpd(8) ACKNOWLEDGEMENTS
OpenLDAP is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). OpenLDAP is derived from University of Michigan LDAP 3.3 Release. OpenLDAP 2.0.27-Release 20 August 2000 SLAPD.REPLOG(5)
All times are GMT -4. The time now is 09:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy