You use Treasure Agent (td-agent) to import logs from your MaxOS X environment. For MacOS X, TD-agent is distributed as a .dmg Installer package. 

td-agent3 is the last supported version that is available for MacOS X. We recommend using MacOS X for testing purposes only and not for production.

Install td-agent on MacOS X

Download the .dmg file and install the software.

Launch TD-agent

You can launch TD-agent with launchctl command. Make sure the daemon started correctly from the log (/var/log/td-agent/td-agent.log).

MacOS X 10.11.1 (El Capitan) introduced some security changes. When the td-agent is installed, edit the /Library/LaunchDaemons/td-agent.plist file to change /usr/sbin/td-agent to /opt/td-agent/usr/sbin/td-agent.
$ sudo launchctl load /Library/LaunchDaemons/td-agent.plist
$ less /var/log/td-agent/td-agent.log
2018-01-01 16:55:03 -0700 [info]: starting fluentd-1.0.2
2018-01-01 16:55:03 -0700 [info]: reading config file path="/etc/td-agent/td-agent.conf"

Your configuration file is located at /etc/td-agent/td-agent.conf. Your plugin directory is at /etc/td-agent/plugin. To stop the agent, execute the following command:

$ sudo launchctl unload /Library/LaunchDaemons/td-agent.plist

Post Sample Logs using HTTP

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 following curl command:

$ curl -X POST -d 'json={"json":"message"}' http://localhost:8888/debug.test
$ tail -n 1 /var/log/td-agent/td-agent.log
2018-01-01 17:51:47 -0700 debug.test: {"json":"message"}

Uninstall TD-agent

td-agent for Mac doesn’t provide an uninstallation application.

To uninstall TD-agent from your Mac, remove these files and directories.

  • /Library/LaunchDaemons/td-agent.plist

  • /etc/td-agent

  • /opt/td-agent

  • /var/log/td-agent

  • No labels