Score:0

Forwarding log of a specific cPanel user from rsyslog.conf to an IP address using TCP

kn flag

Server is on CloudLinux, cPanel, LiteSpeed, imunify and CSF as firewall. i have multiple domains hosted on my server. I only want to forward one user (all) logs to an specific IP address.

Using this code

*.*@@<ip-address>:514

it forward all logs to IP

then i created a file niftlog.conf and included it in rsyslog.conf

$IncludeConfig /etc/rsyslog.d/niftlog.conf

In niftlog.conf file i tried following codes

if $syslogtag contains 'cpanelUserName' then @@<ip-address>:514
#if $programname == 'cpsrvd' and $syslogtag contains 'cpanelUserName' then @<ip-address>:514
#if $programname == 'cpdavd' and $syslogtag contains 'cpanelUserName' then @<ip-address><ip-address>:514
if $programname == 'exim' then @<ip-address>:514
#if $programname == 'pure-ftpd' and $syslogtag contains 'cpanelUserName' then @<ip-address>:514
if $programname == 'httpd' then @@<ip-address>:514

I tried all codes above but logs are not forwarding to specific IP address. Any help would be highly appreciated

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.