# Apache httpd error

{% hint style="info" %}
Apache httpd errorログ収集方法のご案内
{% endhint %}

### 1. conf 設定(rsyslog 使用) <a href="#id-1" id="id-1"></a>

* 80-htpd.conf > conf ファイルを生成する

```
# cd /etc/rsyslog.d/
# vi /etc/rsyslog.d/80-httpd.conf
```

### 2. confファイルの作成 <a href="#id-2" id="id-2"></a>

```
File = "ログ 経路", Tag = "タグ", Severity = "深刻度", programname ="プログラム名"
```

<pre class="language-bash"><code class="lang-bash"><strong>vi /etc/rsyslog.d/80-httpd.conf
</strong></code></pre>

```
#variables required for non-syslog log file forwarding – httpd error log file
#edit on your location

input(type=”imfile”
File=”/var/log/httpd/error_log”
Tag=”httpd”
Severity=”error”
Facility=”local7″)

###### Creates a template for each log file in the Logentries UI
### logic to apply the relevant templates to the different log files

if $programname == ‘httpd‘ then /var/log/plura/ceelog-127.0.0.1.log;CEETemplate
:programname, isequal, ‘httpd‘ stop
```

**2-1. repoからダウンロードする**

```bash
wget https://repo.plura.io/v5/module/rsyslog/80-httpd.conf
```

```bash
curl https://repo.plura.io/v5/module/rsyslog/80-httpd.conf -o /etc/rsyslog.d/80-httpd.conf
```

### 3. rsyslog デーモン再起動 <a href="#id-3" id="id-3"></a>

```bash
service rsyslog restart
```

### 4. 探知確認 <a href="#id-4" id="id-4"></a>

* ログ例 : 全体ログ > ホスト

<figure><img src="/files/8wJzPeMQ6YFfwzoISeEq" alt=""><figcaption></figcaption></figure>

* [x] 上記の内容を活用してフィルターを登録すると、探知ログを確認することができます。

> [https://docs.plura.io/ja/fn/comm/filter/syslog](https://docs.plura.io/ja/function/common/filter/syslog)

### 参考サイト <a href="#id-5" id="id-5"></a>

> <https://www.rsyslog.com/doc/v8-stable/configuration/modules/imfile.html>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.plura.io/ja/agents/siem/uplc/apache-httpd-error.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
