Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've been looking at examples of rsyslogs but most seems too programmer centric for me.

I need 10.10.10.12, 10.10.10.13, 10.10.10.14 to get 1 shared log file.

This gives me the log I want into my main /var/log/syslog

$ModLoad imuxsock # provides support for local system logging
$ModLoad imklog   # provides kernel logging support (previously done by rklogd)
#$ModLoad immark  # provides --MARK-- message capability

# provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514

I tried adding this, but It didn't work.

if $fromhost-ip == '10.10.10.12' then /var/log/aps.log
& ~

if $fromhost-ip == '10.10.10.13' then /var/log/aps.log
& ~

if $fromhost-ip == '10.10.10.14' then /var/log/aps.log
& ~

I updated my code with == as it makes more scene, but it did not fix the problem.

share|improve this question
    
and if $fromhost-ip == '10.10.10.12' then /var/log/aps.log ? Since you provide a full IP ;) –  Rinzwind Apr 10 '13 at 14:45
    
updated post... no difference. –  wlraider70 Apr 10 '13 at 18:47

2 Answers 2

Maybe if $fromhost-ip isequal '10.10.10.14' then /var/log/aps.log ?

You can also try :HOSTNAME, isequal, '10.10.10.14' /var/log/aps.log...

share|improve this answer
    
isequal does not work –  wlraider70 Apr 22 '13 at 17:40
up vote 0 down vote accepted

I made two changes i used $hostname I changed permissions to 777 on the log file.

It works.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.