|
| 1 | +# How to install td-agent and luent-plugin-azure-loganalytics plugin on RHEL |
| 2 | + |
| 3 | +This is a quick installation procedure of td-agent and the custom plugin (fluent-plugin-azure-loganalytics) on Red Hat Enterprise Linux (7.4) |
| 4 | + |
| 5 | +$ cat /etc/os-release |
| 6 | +``` |
| 7 | +NAME="Red Hat Enterprise Linux Server" |
| 8 | +VERSION="7.4 (Maipo)" |
| 9 | +ID="rhel" |
| 10 | +ID_LIKE="fedora" |
| 11 | +VARIANT="Server" |
| 12 | +VARIANT_ID="server" |
| 13 | +VERSION_ID="7.4" |
| 14 | +PRETTY_NAME="Red Hat Enterprise Linux Server 7.4 (Maipo)" |
| 15 | +ANSI_COLOR="0;31" |
| 16 | +CPE_NAME="cpe:/o:redhat:enterprise_linux:7.4:GA:server" |
| 17 | +HOME_URL="https://www.redhat.com/" |
| 18 | +BUG_REPORT_URL="https://bugzilla.redhat.com/" |
| 19 | +
|
| 20 | +REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7" |
| 21 | +REDHAT_BUGZILLA_PRODUCT_VERSION=7.4 |
| 22 | +REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" |
| 23 | +REDHAT_SUPPORT_PRODUCT_VERSION="7.4" |
| 24 | +``` |
| 25 | + |
| 26 | +## 0. prerequisites (for Redhat/Centos) |
| 27 | +Install GCC and Development Tools on a CentOS / RHEL 7 server |
| 28 | +``` |
| 29 | +$ suod yum group install "Development Tools" |
| 30 | +``` |
| 31 | + |
| 32 | +## 1. Install td-agent (fluentd) |
| 33 | + |
| 34 | +Following the fluentd official page, install like this: |
| 35 | +https://docs.fluentd.org/v0.12/articles/install-by-rpm |
| 36 | +``` |
| 37 | +$ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent2.sh | sh |
| 38 | +
|
| 39 | +$ td-agent --version |
| 40 | +td-agent 0.12.40 |
| 41 | +``` |
| 42 | + |
| 43 | +## 2. Launching Daemon |
| 44 | +``` |
| 45 | +$ sudo /etc/init.d/td-agent start |
| 46 | +$ sudo /etc/init.d/td-agent status |
| 47 | +``` |
| 48 | +## 3. Post Sample Logs via HTTP |
| 49 | +By default, /etc/td-agent/td-agent.conf is configured to take logs from HTTP and route them to stdout (/var/log/td-agent/td-agent.log). You can post sample log records using the curl command. |
| 50 | + |
| 51 | +``` |
| 52 | +$ curl -X POST -d 'json={"json":"message"}' http://localhost:8888/debug.test |
| 53 | +
|
| 54 | +# Checking log (/var/log/td-agent/td-agent.log) and see if the log is written |
| 55 | +$ cat /var/log/td-agent/td-agent.log |
| 56 | +``` |
| 57 | + |
| 58 | +## 4. Install the custom plugin |
| 59 | +``` |
| 60 | +$ sudo /usr/sbin/td-agent-gem install fluent-plugin-azure-loganalytics |
| 61 | +``` |
| 62 | + |
| 63 | +## 5. Testing the plugin |
| 64 | +``` |
| 65 | +$ git clone https://github.com/yokawasa/fluent-plugin-azure-loganalytics.git |
| 66 | +$ cd fluent-plugin-azure-loganalytics |
| 67 | +$ /opt/td-agent/embedded/bin/rake test |
| 68 | +``` |
0 commit comments