Re: Obscure rsyslog question on remote logging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Once upon a time, Tom Horsley <horsley1953@xxxxxxxxx> said:
> I found some obscure text about needing to use a $ in front of
> system variables and since $myhostname is a system variable
> I need to type it as $$myhostname in the condition (I think :-)

So an alternate approach that might help... you can assign a ruleset to
an input, and the UDP input is separate from the local input.  I put
this in /etc/rsyslog.d/net.conf:

########################################################################
template(name="Remote" type="list") {
        constant(value="/var/log/remote/")
        property(name="hostname")
        constant(value=".log")
}

module(load="imudp")

$umask 0022
ruleset(name="remote") {
        *.*     action(type="omfile" DynaFile="Remote" fileCreateMode="0644")
}
input(type="imudp" port="514" ruleset="remote")
########################################################################

My template is a simple /var/log/remote/<hostname>.log (I use the really
redundant .log extension so I can have a logrotate config to get
/var/log/remote/*.log).  I set the umask to 0022 and the file create
mode to 0644 because I have the group permissions on the /var/log/remote
directory to allow certain non-root users to read these logs.

-- 
Chris Adams <linux@xxxxxxxxxxx>
--
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux