Sponsored Content
Full Discussion: Grep logs on the fly
Top Forums Shell Programming and Scripting Grep logs on the fly Post 302194400 by Cameron on Monday 12th of May 2008 09:32:12 PM
Old 05-12-2008
true (and how very sad, now reading my post) Smilie .... dang I need a coffee or two ...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep yesterday logs from weblogic logs

Hi, I am trying to write a script which would go search and get the info from the logs based on yesterday timestamp and write yesterday logs in new file. The log file format is as follows: """"""""""""""""""""""""""... (3 Replies)
Discussion started by: harish.parker
3 Replies

2. Shell Programming and Scripting

Grep for lines in web logs

I want to find the unique url in a apache logs which got 404 error . I can do something like "cat apache.log|grep 404|awk '{print $2,$3}'|grep 404 this will give me say /foo.html 404 /foo.html 404 /foo.html 404 /bar.html 404 /cat.html 404 However my output should only find... (3 Replies)
Discussion started by: gubbu
3 Replies

3. Shell Programming and Scripting

how to grep the logs for two particular timestamp

Hi, could anyone help me out how to write a script, to grep the two timestamp from a particular file, so that it will list out all the logs between the particular timestamp I have a pattern of log: servicename operationname starttime endtime eg., servicename1 operationname1 01:11:11... (1 Reply)
Discussion started by: jacktolearn
1 Replies

4. Shell Programming and Scripting

script to grep outofmemory message in logs

I have prepare script to grep for outofmemory messages in the logs. I need help in modifying script. I have implemented small logic. The outofmemory messages form six logs will store in variables. var1=`grep -i outofmemory $tomcat1logs | sed -n '$p'| sed -n -e "s/.*\(outofmemory\).*/\1/p"`... (6 Replies)
Discussion started by: coolguyamy
6 Replies

5. Shell Programming and Scripting

script to grep latest outofmemory string from the logs

I have requirement to prepare script which will grep for latest outofmemory message from the logs. I have used following command to grep the string from the logs,this script is not effective when logs are not getting updated as it will grep for old message. f=catalina.out var=`tail -10 $f |... (17 Replies)
Discussion started by: coolguyamy
17 Replies

6. UNIX for Dummies Questions & Answers

Grep Logs That Are Updating

Hello all. I am new to this forum and also very new to using grep - so please excuse me if this question is not in the correct forum and/or is not pertinent to this website. I use greps like this: gunzip -c L:\System1\SailLogger_20071019* L:\System2\SailLogger_20071019*... (14 Replies)
Discussion started by: Carl2013
14 Replies

7. Shell Programming and Scripting

Script to grep logs for Errors

Hi Guys, I want to write a script which can grep the logs (server.log) from a file for Error String and output to a other file. Problems: How to know about the errors only between the current restart and not in previous as server.log has earlier restarts also? thanks for the help! Much... (5 Replies)
Discussion started by: ankur328
5 Replies

8. Shell Programming and Scripting

Grep a pattern in current date logs

Hello, I need to write one script which should search particular pattern like ABCD in log file name hello.txt only in current date logs. in current directory i have so many past date logs but grep should be applied on current date logs. on daily basis current date logs are in number 30 and... (2 Replies)
Discussion started by: ajju
2 Replies

9. Shell Programming and Scripting

Search string or words in logs without using Grep

I'm in need of some kind of script that will search for a string in each logfile in a directory but we don't want to use GREP. GREP seems to use up to much of our memory causing the server to use up a lot of swap space. Our log files are bigger than 500M on a daily basis. We lately started... (8 Replies)
Discussion started by: senormarquez
8 Replies

10. UNIX for Beginners Questions & Answers

Grep last 5 mins from logs

Hi, system date format Thu Jun 13 12:55:18 EDT 2019 My log date format 09.148.192.60 - - "GET /akamai/sureroute-test-object.html HTTP/1.1" 404 231 can someone please help me, how to get last 5mins of logs please ? I need the command Please wrap your samples/codes in CODE TAGS,... (3 Replies)
Discussion started by: scazed
3 Replies
sad(7)							 Miscellaneous Information Manual						    sad(7)

NAME
sad - STREAMS Administrative Driver SYNOPSIS
#include <sys/types.h> #include <sys/conf.h> #include <sys/sad.h> #include <sys/stropts.h> int ioctl( int fildes, const command, int arg); PARAMETERS
Specifies an open file descriptor of the sad driver. Specifies the administrative function to be performed. Points to a data structure. DESCRIPTION
The sad driver provides an interface to the autopush facility using the ioctl() function. As an interface, the sad driver enables adminis- trative tasks to be performed on STREAMS modules and drivers. Specifically, specifying the command parameter to the ioctl() function, an administrator can configure autopush information for a device, get information on a device, or check a list of modules. To access the sad driver, use /dev/sad/admin. ioctl Commands The commands used to perform administrative functions on a STREAMS module or driver are specified by the following ioctl() commands: Lets you use the sad driver to obtain autopush configuration information for a device by setting the sap_major and sap_minor fields of the stra- push structure (see the SAD_SAP command) to the major and minor device numbers of the device being queried. Upon successful completion, the strapush structure contains all of the information used to configure the device. Values of 0 (zero) will appear in any unused entry in the module list. Allows you to configure autopush information for a device. The arg parameter points to a strapush structure (defined in the sad.h header file), whose members are as follows: struct strapush { uint sap_cmd; long sap_major; long sap_minor; long sap_lastminor; long sap_npush; char sap_list[MAXAPUSH][FMNAMESZ+1]; }; Allows you to specify the type of configuration to perform. This field can have the following values: Configures all minor devices. Configures a range of minor devices. Configures a single minor device. Clears the previous set- tings. Specify only the sap_major and sap_minor fields when using this command. If a previous entry specified SAP_ALL, set the sap_minor field to 0 (zero). If a previous entry was specified as SAP_RANGE, set the sap_minor field to the lowest minor device number in the range. Specifies the major device number. Specifies the minor device number. Specifies the range of minor devices. Specifies the number of mod- ules to push. This number must be no more than MAXAPUSH, which is defined in sad.h. Additionally, this number must not exceed NSTRPUSH. Specifies, in order, the array of modules to push. Enables you to check a list of modules. For example, you can determine if a specific module has been installed. The arg parameter points to a str_list structure (defined in the stropts.h header file), whose members are as follows: struct str_list { int sl_nmods; struct str_mlist *sl_modlist; }; Specifies the number of entries you have allocated in an array. Points to the array of module names. The str_mlist structure (also in the stropts.h header file) is as follows: struct str_mlist { char 1_name[FMNAMESZ+1]; }; where 1_name[FMNAMESZ+1] specifies the array of module names. If the 1_name[FMNAMESZ+1] array is valid, the SAD_VML command returns a value of 0 (zero). If the array contains an invalid module name, the command returns a value of 1. Upon failure, the command returns a value of -1. NOTES
As a STREAMS driver, sad also supports the normal STREAMS ioctl(): int ioctl( int fildes, const I_STR, struct strioctl *strp); In this form, specify the ic_cmd field in the strioctl structure to either SAD_SAP, SAD_GAP, or SAD_VML. The ic_dp field points to the strapush structure (see the SAD_SAP command in the DESCRIPTION section). Refer to the streamio() reference page for further details. RETURN VALUES Unless specified otherwise, upon successful completion, the sad ioctl() commands return a value of 0 (zero). Otherwise, a value of -1 is returned. ERRORS
If any of the following conditions occur, the sad ioctl commands return the corresponding value: SAD_GAP The arg parameter points outside the allocated address space. The major device number (sad_major) is invalid. The device is not configured for autopush. The major device does not represent a STREAMS driver. SAD_SAP The specified major/minor device number pair (sad_major/sad_minor) has already been configured. The arg parameter points outside the allocated address space. The major device number (sad_major) is invalid, the number of modules (sap_list[MAXPUSH][FMNAMESZ+1]) is invalid, or the list of module names is invalid. The device is not configured for autopush. This value is returned from a SAD_GAP com- mand. A internal autopush data structure cannot be allocated. The major device does not represent a STREAMS driver. The sap.lastminor field is less than the sap_minor field when the command is SAP_RANGE, or the minor device specified in a SAP_CLEAR command does not exist. SAD_VML The arg parameter points outside the allocated address space. The list of module names is invalid. RELATED INFORMATION
Commands: autopush(8). Functions: ioctl(2). Interfaces: streamio(7). delim off sad(7)
All times are GMT -4. The time now is 04:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy