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(7D) 							      Devices								   sad(7D)

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, int command, int arg); DESCRIPTION
The STREAMS Administrative Driver provides an interface for applications to perform administrative operations on STREAMS modules and drivers. The interface is provided through ioctl(2) commands. Privileged operations may access the sad driver using /dev/sad/admin. Unprivileged operations may access the sad driver using /dev/sad/user. The fildes argument is an open file descriptor that refers to the sad driver. The command argument determines the control function to be performed as described below. The arg argument represents additional information that is needed by this command. The type of arg depends upon the command, but it is generally an integer or a pointer to a command-specific data structure. COMMAND FUNCTIONS
The autopush facility (see autopush(1M)) allows one to configure a list of modules to be automatically pushed on a stream when a driver is first opened. Autopush is controlled by the following commands:"7">SAD_SAPAllows the administrator to configure the given device's autopush information. arg points to a strapush structure, which contains the following members: unit_t ap_cmd; major_t sap_major; minor_t sap_minor; minor_t sap_lastminor; unit_t sap_npush; unit_t sap_list [MAXAPUSH] [FMNAMESZ + 1]; The sap_cmd field indicates the type of configuration being done. It may take on one of the following values: "small and bold"Configure one minor device of a driver. SAP_RANGE Configure a range of minor devices of a driver. SAP_ALL Configure all minor devices of a driver. SAP_CLEAR Undo configuration information for a driver. The sap_major field is the major device number of the device to be configured. The sap_minor field is the minor device number of the device to be configured. The sap_lastminor field is used only with the SAP_RANGE command, which configures a range of minor devices between sap_minor and sap_lastminor, inclusive. The minor fields have no meaning for the SAP_ALL command. The sap_npush field indicates the number of modules to be automatically pushed when the device is opened. It must be less than or equal to MAXAPUSH , defined in sad.h. It must also be less than or equal to NSTRPUSH, the maximum number of modules that can be pushed on a stream, defined in the kernel mas- ter file. The field sap_list is an array of NULL-terminated module names to be pushed in the order in which they appear in the list. When using the SAP_CLEAR command, the user sets only sap_major and sap_minor. This will undo the configuration information for any of the other commands. If a previous entry was configured as SAP_ALL, sap_minor should be set to zero. If a previous entry was configured as SAP_RANGE , sap_minor should be set to the lowest minor device number in the range configured. On failure, errno is set to the following value: EFAULT arg points outside the allocated address space. EINVAL The major device number is invalid, the number of modules is invalid, or the list of module names is invalid. ENOSTR The major device number does not represent a STREAMS driver. EEXIST The major-minor device pair is already configured. ERANGE The command is SAP_RANGE and sap_lastminor is not greater than sap_minor, or the command is SAP_CLEAR and sap_minor is not equal to the first minor in the range. ENODEV The command is SAP_CLEAR and the device is not configured for autopush. ENOSR An internal autopush data structure cannot be allocated. SAD_GAP Allows any user to query the sad driver to get the autopush configuration information for a given device. arg points to a strapush structure as described in the previous command. The user should set the sap_major and sap_minor fields of the strapush structure to the major and minor device numbers, respectively, of the device in question. On return, the strapush structure will be filled in with the entire information used to configure the device. Unused entries in the module list will be zero-filled. On failure, errno is set to one of the following values: EFAULT arg points outside the allocated address space. EINVAL The major device number is invalid. ENOSTR The major device number does not represent a STREAMS driver. ENODEV The device is not configured for autopush. SAD_VML Allows any user to validate a list of modules (that is, to see if they are installed on the system). arg is a pointer to a str_list structure with the following members: int sl_nmods; struct str_mlist *sl_modlist; The str_mlist structure has the following member: char l_name[FMNAMESZ+1]; sl_nmods indicates the number of entries the user has allocated in the array and sl_modlist points to the array of module names. The return value is 0 if the list is valid, 1 if the list contains an invalid module name, or -1 on failure. On failure, errno is set to one of the following values: EFAULT arg points outside the allocated address space. EINVAL The sl_nmods field of the str_list structure is less than or equal to zero. SEE ALSO
intro(2), ioctl(2), open(2) STREAMS Programming Guide DIAGNOSTICS
Unless otherwise specified, the return value from ioctl() is 0 upon success and -1 upon failure with errno set as indicated. SunOS 5.10 16 Apr 1997 sad(7D)
All times are GMT -4. The time now is 02:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy