How to connect Apache log to graylog2 server
Asked Answered
C

2

6

I'm using Graylog2 server as my application log server. But couldn't connect apache log to graylog2. Is there any guide to send apache log to graylog2 server or can someone help me to solve this ?

Cleaves answered 18/1, 2014 at 12:27 Comment(0)
S
2

I put this at the bottom of my /etc/rsyslog.conf on Ubuntu 14.04

# Apache access file:

$ModLoad imfile
$InputFileName /var/log/apache2/access.log
$InputFileTag apache-access:
$InputFileStateFile stat-apache-access
$InputFileSeverity info
$InputRunFileMonitor

#Apache Error file:

$InputFileName /var/log/apache2/error.log
$InputFileTag apache-errors:
$InputFileStateFile stat-apache-error
$InputFileSeverity error
$InputRunFileMonitor

$InputFilePollInterval 10

if $programname == 'apache-access' then @10.11.11.33:514
if $programname == 'apache-errors' then @10.11.11.33:514

where 10.x.x.x is my Graylog2 server.

Septima answered 20/1, 2015 at 22:3 Comment(0)
L
1

There will be a GELF module for Apache soon. Until that is released I can recommend using Logstash to parse and forward the Apache log files. You could even send in the log lines to "Raw/Plaintext" inputs in Graylog2 using tail and netcat.

Leavelle answered 20/1, 2014 at 9:49 Comment(1)
Lennart, I've seen you extractor on the GrayLog website. Any news with the GELF module or a more thorough extractor? Thanks.Oogonium

© 2022 - 2024 — McMap. All rights reserved.