# How to import apache logs to graylog

**URL:** <https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874>\
**Category:** Graylog Central (peer support)\
**Tags:** sidecar\
**Created:** [July 5, 2018, 3:14am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874 "2018-07-05T03:14:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![hussain](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@hussain](https://community.graylog.org/u/hussain)\
**Post date:** [July 5, 2018, 3:14am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/1 "2018-07-05T03:14:20Z")

</div>

Hello everyone, I was asked to configure graylog for centralized log monitoring. I have configured graylog on Centos 7. I have exported rsyslog to graylog but now I need to export apache logs to graylog. Please advise how it can accomplished.

Regards,

Hussain Gany

---

<div class="post-metadata">

**Author:** ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)\
**Post date:** [July 5, 2018, 6:32am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/2 "2018-07-05T06:32:41Z")

</div>

He Hussain,

you would need to ship your Apache logs to Graylog. That can be done by using shipper, like filebeat your rsyslog or nxlog (or any other you like).

What fits your environment you need to decide yourself. Personal I would you filebeat. Managed manually or by the collector-sidecar.

---

<div class="post-metadata">

**Author:** ![juemue](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@juemue](https://community.graylog.org/u/juemue)\
**Post date:** [July 5, 2018, 7:28am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/3 "2018-07-05T07:28:59Z")

</div>

@hussain

We use filebeat with collectore-sidecar, it works well.

Tip:  
We use an own json logformat, like

```
#secweb_extended version JSON format
LogFormat "{ \"host\":\"%h\",\
\"GEOIP_COUNTRY_CODE\":\" %{GEOIP_COUNTRY_CODE}e\",\
\"User\":\"%u\",\
\"timestamp\":%{%s}t,\
.....
 \"short_message\":\"%r\" }" secweb_extended_json

```

This makes it easier to parse

---

<div class="post-metadata">

**Author:** ![hussain](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@hussain](https://community.graylog.org/u/hussain)\
**Post date:** [July 5, 2018, 8:45am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/4 "2018-07-05T08:45:38Z")

</div>

Hi Jan,

I have installed graylog 1.2.2 on Centos 7. What version of collector-sidecar should be installed? I have installed “collector-sidecar-0.1.5-1.x86\_64” and nxlog in client machine but I am unable to start the collector-sidecar service as it says Unrecognized service.

---

<div class="post-metadata">

**Author:** ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)\
**Post date:** [July 5, 2018, 8:57am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/5 "2018-07-05T08:57:24Z")

</div>

that historical version of Graylog does not support Collector Sidecar - it does also not have a beats input working with filebeat.

You should use a stable supported version of Graylog which is 2.4.5 at the time of writing.

---

<div class="post-metadata">

**Author:** ![hussain](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@hussain](https://community.graylog.org/u/hussain)\
**Post date:** [July 5, 2018, 9:13am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/6 "2018-07-05T09:13:06Z")

</div>

Thanks Jan for your suggestion. Tomorrow morning let me start with installation of graylog 2.4.5.

---

<div class="post-metadata">

**Author:** ![hussain](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@hussain](https://community.graylog.org/u/hussain)\
**Post date:** [July 6, 2018, 3:34am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/7 "2018-07-06T03:34:12Z")

</div>

Hi Jan,

I was able to export Rsyslog to Graylog when I was using graylog 1.2.2. After successful installation of Graylog 2.4.5, I am facing difficulties in exporting rsyslog of remote machine.Please advise.

vi /etc/rsyslog.conf

$ModLoad imudp  
$UDPServerRun 1514

```
   *.* @10.6.14.82:1514;RSYSLOG_SyslogProtocol23Format
```

---

<div class="post-metadata">

**Author:** ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)\
**Post date:** [July 6, 2018, 6:33am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/8 "2018-07-06T06:33:54Z")

</div>

Did you have on the IP `10.6.14.82` on Port `1514` your UDP Syslog Input running at the Graylog server?

---

<div class="post-metadata">

**Author:** ![hussain](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@hussain](https://community.graylog.org/u/hussain)\
**Post date:** [July 6, 2018, 7:11am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/9 "2018-07-06T07:11:14Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/8/8552d97f3ed68a9b0d9418b71fc1175d76b1b881.png)

---

<div class="post-metadata">

**Author:** ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)\
**Post date:** [July 6, 2018, 7:28am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/10 "2018-07-06T07:28:55Z")

</div>

you have the port `1514` on some IP open accepting connections - ok.

But is the IP you use in the rsyslog configuration available at the Graylog server? Did you check if no firewall in between is blocking? Can the sending server reach the Graylog server?

---

<div class="post-metadata">

**Author:** ![hussain](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@hussain](https://community.graylog.org/u/hussain)\
**Post date:** [July 6, 2018, 8:38am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/11 "2018-07-06T08:38:13Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/c/c27074900b885c16ae18f8ac2cb551240d64e6a5.png)

I am getting above error in graylog.log file.

---

<div class="post-metadata">

**Author:** ![hussain](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@hussain](https://community.graylog.org/u/hussain)\
**Post date:** [July 6, 2018, 8:39am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/12 "2018-07-06T08:39:09Z")

</div>

Open port 1514 has to checked in Client server or graylog server (10.6.14.82). Please advise.

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [July 6, 2018, 8:50am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/13 "2018-07-06T08:50:04Z")

</div>

> [@hussain](#):
>
> I am getting above error in graylog.log file.

If Graylog is unable to connect to Elasticsearch, it won’t be able to index new messages.

Check the logs of your Elasticsearch node(s): [http://docs.graylog.org/en/2.4/pages/configuration/file\_location.html](http://docs.graylog.org/en/2.4/pages/configuration/file_location.html)

---

<div class="post-metadata">

**Author:** ![hussain](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@hussain](https://community.graylog.org/u/hussain)\
**Post date:** [July 6, 2018, 8:54am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/14 "2018-07-06T08:54:37Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/b/bd5a0a2db4a3fe4596d52bbd2d760159ebd331cf.png)

Please find the above log from Elasticsearch.

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [July 6, 2018, 8:56am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/15 "2018-07-06T08:56:21Z")

</div>

Are Elasticsearch and Graylog running on the same machine?

If not, using the loopback interface ([https://en.wikipedia.org/wiki/Loopback#Virtual\_loopback\_interface](https://en.wikipedia.org/wiki/Loopback#Virtual_loopback_interface)) won’t work.

---

<div class="post-metadata">

**Author:** ![hussain](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@hussain](https://community.graylog.org/u/hussain)\
**Post date:** [July 6, 2018, 8:57am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/16 "2018-07-06T08:57:07Z")

</div>

Yes both are running in the same machine.

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [July 6, 2018, 8:58am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/17 "2018-07-06T08:58:46Z")

</div>

What’s the output of the following command on the machine running Graylog?

```nohighlight
# curl -i 'http://127.0.0.1:9200/?pretty'

```

---

<div class="post-metadata">

**Author:** ![hussain](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@hussain](https://community.graylog.org/u/hussain)\
**Post date:** [July 6, 2018, 9:06am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/18 "2018-07-06T09:06:41Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/e/e18b62f75c2e3a2ce1182367235ad2720001e683.png)

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [July 6, 2018, 9:15am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/19 "2018-07-06T09:15:30Z")

</div>

Then Graylog should be able to communicate with Elasticsearch at `http://127.0.0.1:9200`.

Try restarting Graylog and watch the logs of both, Graylog and Elasticsearch.

---

<div class="post-metadata">

**Author:** ![hussain](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@hussain](https://community.graylog.org/u/hussain)\
**Post date:** [July 9, 2018, 2:20am UTC](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874/20 "2018-07-09T02:20:49Z")

</div>

Hi Jochen,

I have configured graylog 2.4.5 on another machine but now I am able to collect windows logs. Still I am unable to collect Syslog from Linux machine. Please correct me where I have made mistake?

[Next page](https://community.graylog.org/t/how-to-import-apache-logs-to-graylog/5874.md?page=2)
