Logentries Docs

Find comprehensive guides and documentation to help you start and continue to work with Logentries.

    

Search results for "{{ search.query }}"

No results found for "{{search.query}}".
View All Results

CoreOS is a Linux distribution with an emphasis on providing features needed to run modern infrastructure stacks. Using journal-2-logentries, you can send your CoreOS systemd journal entries to Logentries over SSL.

Getting Started

  1. Create a new log in your Logentries account by clicking + Add New Log.

  2. Next, select Manual Configuration.

  1. Give your log a name of your choice, select Token TCP, and then click the Register new log button. A token will be displayed in green. Please record the token, as we’ll need it when configuring journal-2-logentries.

Docker

Using the docker command, you can run a pre-configured journal-2-logentries Docker image. Run the following to start the process in a new container:

sudo docker run -d -e 'LOGENTRIES_TOKEN=YOUR_LOG_TOKEN' -v /run/journald.sock:/run/journald.sock \
quay.io/kelseyhightower/journal-2-logentries

In the above, replace YOUR_LOG_TOKEN with the token for the log you created initially. The command will output the container ID and begin forwarding your logs to Logentries.

Fleet Integration

Fleet allows you to treat your CoreOS cluster as if it shared a single init system. To configure journal-2-logentries for Fleet, simply follow the steps below:

  1. Add the following to your cloud-config.yaml file to configure the systemd-journal-gatewayd socket:
#cloud-config
    coreos: 
      units: 
         - name: systemd-journal-gatewayd.socket 
         command: start 
         enable: yes 
         content: | 
           [Unit] 
           Description=Journal Gateway Service Socket 
           [Socket] 
           ListenStream=/var/run/journald.sock 
           Service=systemd-journal-gatewayd.service 
           [Install] 
           WantedBy=sockets.target
  1. Set the LOGENTRIES_TOKEN environment variable by running:
    etcdctl set /logentries.com/token YOUR_LOG_TOKEN
  2. Next, edit or create journal-2-logentries.service in /etc/systemd/system/A sample configuration appears below:
    ```
    [Unit]
    Description=Forward Systemd Journal to logentries.com

[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill journal-2-logentries
ExecStartPre=-/usr/bin/docker rm journal-2-logentries
ExecStartPre=/usr/bin/docker pull quay.io/kelseyhightower/journal-2-logentries
ExecStart=/usr/bin/bash -c \
"/usr/bin/docker run --name journal-2-logentries \
-v /run/journald.sock:/run/journald.sock \
-e LOGENTRIES_TOKEN=$(etcdctl get /logentries.com/token) \
quay.io/kelseyhightower/journal-2-logentries"

[X-Fleet]
Global=true


Start the unit by running:
`fleetctl start journal-2-logentries.service`

## Using Cloud-Config

In larger or auto-scaling environments you may wish to automate the creation of the journal-2-logentries service. One way to accomplish this is by using a cloud-config file as shown below:

cloud-config

coreos:
units:

- name: systemd-journal-gatewayd.socket
  command: start
  enable: yes
  content: |
    [Unit] 
    Description=Journal Gateway Service Socket
    [Socket] 
    ListenStream=/var/run/journald.sock
    Service=systemd-journal-gatewayd.service
    [Install] 
    WantedBy=sockets.target
- name: journal-2-logentries.service
  command: start
  content: |
    [Unit]
    Description=Forward Systemd Journal to logentries.com
    After=docker.service
    Requires=docker.service
    [Service]
    TimeoutStartSec=0
    ExecStartPre=-/usr/bin/docker kill journal-2-logentries
    ExecStartPre=-/usr/bin/docker rm journal-2-logentries
    ExecStartPre=/usr/bin/docker pull quay.io/kelseyhightower/journal-2-logentries
    ExecStart=/usr/bin/bash -c \
    "/usr/bin/docker run --name journal-2-logentries \
    -v /run/journald.sock:/run/journald.sock \
    -e LOGENTRIES_TOKEN=`etcdctl get /logentries.com/token` \
    quay.io/kelseyhightower/journal-2-logentries"
```

CoreOS