Score:0

How does rsyslog accept remote logs to be written to the specified file path?

sd flag

I want to write remote logs to the /data directory

# cat /etc/rsyslog.d/default.conf
#### GLOBAL DIRECTIVES ####

$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$template myFormat,"%timestamp% %fromhost-ip% %syslogtag% %msg%\n"
$ActionFileDefaultTemplate myFormat

$template RemoteFirewallLogs,"/data/%fromhost-ip%/%$YEAR%-%$MONTH%/%$YEAR%-%$MONTH%-%$DAY%.log"
local2.* !isequal, "127.0.0.1"  ?RemoteFirewallLogs
& ~

As a result, the remote log is still written to /var/log/messages, which does not meet my expectations!

I sit in a Tesla and translated this thread with Ai:

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.