> For the complete documentation index, see [llms.txt](https://docs.plura.io/ja/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.plura.io/ja/faq/siem/syslog/tomcat-catalina.out.md).

# Tomcat catalina.outログ

シナリオは下記の通りです。

{% hint style="info" %}

```
クライアントのアプリケーションログを“PLURA V5 Log Collectorサーバー”を使用して転送する方法

 アプリケーションログの中、この例ではTomcat8のcatalina.outを使用します。

 PLURA Log Collectorサーバー使用の利点はクライアント(Web Server)に別のログを生成せずにsyslogにすぐ転送するので、リソース使用量
 （CPU、メモリなど）を最小限に抑えることができます。 
```

{% endhint %}

<figure><img src="https://2905490945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fggd4Oi5rCa2J3EuvDJKc%2Fuploads%2FEZNCnPdlKuEmwLWdImWM%2Fimage.png?alt=media&amp;token=105f0427-c3f3-4e2c-a0c5-e1eab320ba9f" alt=""><figcaption></figcaption></figure>

### 1. クライアント: Tomcat8のcatalina.out <a href="#id-1" id="id-1"></a>

環境: CentOS 6 (64ビット), Rsyslog 5.8.10

<br>

#### 1-1. rsyslog.confダウンロード

`# curl -s https://repo.plura.io/v5/module/rsyslog/v5-stable/00-imfile.conf -o /etc/rsyslog.d/00-imfile.conf`

`# curl -s https://repo.plura.io/v5/module/rsyslog/v5-stable/80-tomcat.conf -o /etc/rsyslog.d/80-tomcat.conf`

<br>

#### 1-2. rsyslog.conf remote rsyslogサーバーに転送修正

`# vi /etc/rsyslog.d/80-tomcat.conf`

{% hint style="info" %}

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

 $InputFileName /var/log/tomcat8/catalina.out
 $InputFileTag tomcat8:
 $InputFileStateFile stat-catalina.out

 $InputFileSeverity info
 $InputFileFacility local7
 $InputRunFileMonitor

 # Send to remote rsyslog server using UDP
 if $programname == ‘tomcat8’ then @PLURA_Log_Collector_Server:514 #UDP
 :programname, isequal, “tomcat8” ~
```

{% endhint %}

#### 1-3. rsyslog restart

`# service rsyslog restart`

<br>

#### 1-4. サーバー接続debug

`# nc -zu PLURA_Log_Collector_Server 514`

{% hint style="info" %}

```
Connection to PLURA_Log_Collector_Server 514 port [udp/syslog] succeeded!
```

{% endhint %}

### 2. サーバー <a href="#id-2" id="id-2"></a>

환경 : CentOS 7, Rsyslog 8.2010.0

<br>

#### 2-1. [PLURA Log Collector サーバーインストール](https://qubitsec.github.io/ja_logcol_application.html)

<br>

#### 2-2. Remote クライアントのsyslog転送オープン

`# firewall-cmd –add-port 514/udp`

`# firewall-cmd –reload`

<br>

#### 2-3. パスにファイル受信可否確認

`# ls -al /var/log/plura/`

<br>

### 内部ブログ <a href="#id-3" id="id-3"></a>

<https://docs.plura.io/ja/agents/siem/uplc/application-log-plc>

<br>

### 外部参考サイト <a href="#id-4" id="id-4"></a>

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

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

<http://linuxsysconfig.com/how-to-configure-remote-logging-on-rhel6-centos6/>

<https://www.teimouri.net/centralized-logs-rsyslog/>
