My syslog in AIX forwards all user facility to a specific log /logs/user.log
I need to further segregate the user.log to logs specific to various applications and i was wondering if i can make some configuration change to syslog.conf to forward messages based on a certain keyword?
for eg:
currently the configuration in syslog.conf is as below:
Moderator's Comments:
Use code tags, thanks.
Last edited by zaxxon; 10-06-2015 at 05:08 AM..
Reason: code tags
Hi,
what is the difference between use and require keywords in Perl.
What is the significance of these lines (what it mean, what is the use of this)
#!/usr/bin/perl -w // In Perl script....
#!/bin/ksh //In shell script.....
Thanks
Sweta (2 Replies)
hey guys,
Hey all,
I'm doing a project currently and want to index words in a webpage.
So there would be a file with webpage content and a file with list of words, I want an output file with true and false that would show which word exists in the webpage.
example:
Webpage content... (2 Replies)
Hi All,
Please help with code for this.
I want to parse several huge files and summarize relevant information into columns.
The columns of output are title, pagebegin,pageend, author1,author2....,author8, abstract. Column descriptions are as follows.
Title
Line after single integer value... (3 Replies)
Hi
I want to extract all the words between two keywords HELLO & BYE.
eg:
Input
1_HELLO_HOW_ARE_YOU_BYE_TEST
1_HELLO_WHERE_ARE_BYE_TEST
1_HELLO_HOW_BYE_TEST
Output Required:
HOW_ARE_YOU
WHERE_ARE
HOW (7 Replies)
Hi
I am trying to determine number of lines having a specific keyword.
So for that I am using below query:
grep -i 'keyword1' filename|wc -l
This give me number of lines. Perfect for me.
However now the requirement is
I have multiple keywords together... and I have to find number of... (3 Replies)
I have below text file only with one line:
vi test.txt
This is the first test from a1.loa1 a1v1, b2.lob2, "c3.loc3" c3b1, loc4 but not from mot3 and second test from a5.loa5
Below should be the output that i want:
a1.loa1
b2.lob2
c3.loc3
loc4
a5.loa5
alv1 and c3b1 should be... (3 Replies)
I need to split the file contents with multiple rows based on patterns
Sample:
Input:
ABC101testXYZ102UKMNO1092testing
ABC999testKMNValid
Output:
ABC101test
XYZ102U
KMN1092testing
ABC999test
KMNValid
In this ABC , XYZ and KMN are patterns (6 Replies)
Discussion started by: Jairaj
6 Replies
LEARN ABOUT PHP
syslog
SYSLOG(3) 1 SYSLOG(3)syslog - Generate a system log messageSYNOPSIS
bool syslog (int $priority, string $message)
DESCRIPTION syslog(3) generates a log message that will be distributed by the system logger.
For information on setting up a user defined log handler, see the syslog.conf(5) Unix manual page. More information on the syslog facili-
ties and option can be found in the man pages for syslog(3) on Unix machines.
PARAMETERS
o $priority
-$priority is a combination of the facility and the level. Possible values are:
syslog(3) Priorities (in descending order)
+------------+------------------------------------+
| Constant | |
| | |
| | Description |
| | |
+------------+------------------------------------+
| | |
| LOG_EMERG | |
| | |
| | system is unusable |
| | |
| | |
| LOG_ALERT | |
| | |
| | action must be taken immediately |
| | |
| | |
| LOG_CRIT | |
| | |
| | critical conditions |
| | |
| | |
| LOG_ERR | |
| | |
| | error conditions |
| | |
| | |
|LOG_WARNING | |
| | |
| | warning conditions |
| | |
| | |
|LOG_NOTICE | |
| | |
| | normal, but significant, condition |
| | |
| | |
| LOG_INFO | |
| | |
| | informational message |
| | |
| | |
| LOG_DEBUG | |
| | |
| | debug-level message |
| | |
+------------+------------------------------------+
o $message
- The message to send, except that the two characters %m will be replaced by the error message string (strerror) corresponding to
the present value of errno.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Using syslog(3)
<?php
// open syslog, include the process ID and also send
// the log to standard error, and use a user defined
// logging mechanism
openlog("myScriptLog", LOG_PID | LOG_PERROR, LOG_LOCAL0);
// some code
if (authorized_client()) {
// do something
} else {
// unauthorized client!
// log the attempt
$access = date("Y/m/d H:i:s");
syslog(LOG_WARNING, "Unauthorized client: $access {$_SERVER['REMOTE_ADDR']} ({$_SERVER['HTTP_USER_AGENT']})");
}
closelog();
?>
NOTES
On Windows NT, the syslog service is emulated using the Event Log.
Note
Use of LOG_LOCAL0 through LOG_LOCAL7 for the $facility parameter of openlog(3) is not available in Windows.
SEE ALSO openlog(3), closelog(3).
PHP Documentation Group SYSLOG(3)