- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- perl Sys::Syslog logs fqdn
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2007 05:06 AM
тАО03-26-2007 05:06 AM
perl Sys::Syslog logs fqdn
MMM DD HH:MM:SS LF:name tag: message
where LF are level and facility ( I use -v in syslog options), and name = simple host name.
And, if I use logger to log a message, I get the same format.
BUT, if I use a perl program, the simple host name becomes a fully qualified host.domain-name.
Is there a way to use the perl module Sys::Syslog to log messages with only the simple host name, not the fully qualified name?
(I'm looking, and trying various things, but don't see a way. I guess I could use system or backticks to call logger...)
Thanks.
- Tags:
- Perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2007 05:10 AM
тАО03-26-2007 05:10 AM
Re: perl Sys::Syslog logs fqdn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2007 05:15 AM
тАО03-26-2007 05:15 AM
Re: perl Sys::Syslog logs fqdn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2007 05:15 AM
тАО03-26-2007 05:15 AM
Re: perl Sys::Syslog logs fqdn
I don't think that you can control the logging (but then why?). WHen you extract your log, simply snip/substitute off the domain name.
# echo "server.in.domain"|perl -nle 'print $1 if /(.+?)(\..+)/'
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2007 05:21 AM
тАО03-26-2007 05:21 AM
Re: perl Sys::Syslog logs fqdn
Clay, I tried using openlog, and without using openlog. Using openlog, with $ident = simple hostname, I get the same format
MMM DD HH:MM:SS LF:name tag: message
where name = fully qualified name, and tag = the simple host name that I put in $ident.
JRF, the syslog is forwarded to another system managed by someone else, who is creating reports from it. I was just in the initial stages of developing this, and thought it would be simpler for them if the messages all had the same format.