Skip to content

Instantly share code, notes, and snippets.

@jorihardman
Last active April 27, 2023 18:43
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save jorihardman/f3507764762e876cc9df to your computer and use it in GitHub Desktop.
Save jorihardman/f3507764762e876cc9df to your computer and use it in GitHub Desktop.
Elastic Beanstalk Sumo Logic Config
# This will automatically install the Sumo Logic collector on AWS Elastic
# Beanstalk instances. Add this to the .ebextensions folder in your app root
# and edit L24-25 to match your Sumo Logic accessid and accesskey. To add or
# remove tracked files, simply add or remove source hashes to the sources
# array on L36.
packages:
rpm:
SumoCollector: https://collectors.sumologic.com/rest/download/rpm/64
services:
sysvinit:
collector:
enabled: true
ensureRunning: true
files:
- /etc/sumo.conf
files:
"/etc/sumo.conf":
mode: "000755"
owner: root
group: root
content: |
accessid=YOURACCESSID
accesskey=YOURACCESSKEY
rpmAutoStart=false
syncSources=/etc/sumo_sources.json
"/etc/sumo_sources.json":
mode: "000755"
owner: root
group: root
content: |
{
"api.version": "v1",
"sources": [
{
"sourceType": "LocalFile",
"name": "rails",
"pathExpression": "/var/log/puma/puma.log"
},
{
"sourceType": "LocalFile",
"name": "eb activity",
"pathExpression": "/var/log/eb-activity.log"
},
{
"sourceType": "LocalFile",
"name": "nginx access",
"pathExpression": "/var/log/nginx/access.log"
}
]
}
@ryangardner
Copy link

Also, be sure to set "ephemeral=true" or else you'll get a lot of dangling collectors

https://help.sumologic.com/Send_Data/Installed_Collectors/stu_user.properties/Setting_a_Collector_as_Ephemeral

@JefStat
Copy link

JefStat commented Mar 7, 2017

Here's some changes taking into account some of the suggestions here:
https://gist.github.com/JefStat/98891d947a1bbadedcf25921b116e413

  • Added ephemeral
  • switched to using user.properties
  • sumologic logs added to the log collector in beanstalk
  • access keys set via environment variable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment