<div dir="ltr">Hi, <div><br></div><div>Thank you spending the time with the sample config. </div><div>It looks like what I want!</div><div><br></div><div>However, Would it be performance "greedy"? </div><div><br></div><div>I read about the new BSD syslog protocol and IETF syslog protocol, doing comparison on the cost-benifit analysis on "upgrading" to using the protocol. </div><div><br></div><div>I saw that the new IETF syslog protocol cater for a "APP-NAME" variable. Logically speaking, would I able to read in the logs, specify the "APP-NAME", on the server site, filter out this "APP-NAME"?</div><div><br></div><div>I have not had the time to really sit down and experiment and look though all the modules options and switches. I want to gather more information before i sit down and start the "trial and error" process. </div><div><br></div><div>Yours Sincerely,</div><div>Delon Lee</div><div><br><div class="gmail_quote"><div dir="ltr">On Wed, 9 May 2018 at 18:48 Gergely Nagy <<a href="mailto:algernon@balabit.com">algernon@balabit.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">>>>>> "Delon" == Delon Lee Di Lun <<a href="mailto:lee.delon2005@gmail.com" target="_blank">lee.delon2005@gmail.com</a>> writes:<br>
<br>
Delon> Possible to wipe up a sample config?<br>
Delon> Might clear things up?<br>
<br>
This is a slightly different solution, but should work nevertheless:<br>
<br>
Client:<br>
<br>
@version: 3.15<br>
<br>
source s_apache_logs {<br>
wildcard-file(<br>
base-dir("/var/log/apache")<br>
filename-pattern("www.*")<br>
flags(no-parse)<br>
);<br>
};<br>
<br>
destination d_central {<br>
network("1.2.3.4" template("$(basename ${FILE_NAME}),${MSG}\n"));<br>
};<br>
<br>
log { source(s_apache_logs); destination(d_central); };<br>
<br>
Server:<br>
<br>
@version: 3.15<br>
<br>
source s_net {<br>
network("1.2.3.4" flags(no-parse));<br>
};<br>
<br>
parser p_apache {<br>
csv-parser(<br>
columns("apache.FILE_NAME", "apache.MESSAGE");<br>
flags(greedy);<br>
);<br>
};<br>
<br>
destination d_central_apache {<br>
file("/var/log/apache/${apache.FILE_NAME}"<br>
template("${apache.MESSAGE}\n"));<br>
};<br>
<br>
log { source(s_net); parser(p_apache); destination(d_central_apache); };<br>
<br>
------------ * --------------<br>
<br>
The idea here is that on the client, we read the apache logs as-is, and<br>
forward them with the filename prepended. On the server side, we split<br>
the message into filename and message, and use the first part to<br>
determine which file to save the message to. Then we write the rest of<br>
the line to that file.<br>
<br>
This way you'll end up with the same contents on both sides, in files<br>
that have the same name (but perhaps different path, that part is up to<br>
you).<br>
<br>
Hope this helps.<br>
<br>
-- <br>
|8]<br>
</blockquote></div></div></div>