Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
# To add or remove tracked files, simply add or remove source hashes to the
# sources array.
packages:
rpm:
SumoCollector: https://collectors.sumologic.com/rest/download/rpm/64
services:
sysvinit:
collector:
enabled: true
ensureRunning: true
files:
"/home/ec2-user/setup-sumo.sh":
mode: "000755"
owner: root
group: root
content: |
cat >/opt/SumoCollector/config/user.properties <<EOL
accessid=$SUMOLOGIC_ACCESS_ID
accesskey=$SUMOLOGIC_ACCESS_KEY
category=$SUMOLOGIC_SOURCE_CATEGORY
rpmAutoStart=false
syncSources=/etc/sumo-sources.json
ephemeral=true
syncSources=/opt/SumoCollector/config/sumo_sources.json
sources=/opt/SumoCollector/config/sumo_sources.json
EOL
"/opt/SumoCollector/config/sumo_sources.json":
mode: "000755"
owner: root
group: root
content: |
{
"api.version": "v1",
"sources": [
{
"sourceType": "LocalFile",
"pathExpression": "/var/log/eb-docker/containers/eb-current-app/*.log",
"multilineProcessingEnabled": true,
"useAutolineMatching": true,
"automaticDateParsing": true
}
]
}
"/opt/elasticbeanstalk/tasks/taillogs.d/sumo-logic.conf" :
mode: "000755"
owner: root
group: root
content: |
/opt/SumoCollector/logs/*
"/opt/elasticbeanstalk/tasks/bundlelogs.d/sumo-logic.conf" :
mode: "000755"
owner: root
group: root
content: |
/opt/SumoCollector/logs/*
"/opt/elasticbeanstalk/tasks/publishlogs.d/sumo-logic.conf" :
mode: "000755"
owner: root
group: root
content: |
/opt/SumoCollector/logs/*
container_commands:
setup_sumo:
command: /home/ec2-user/setup-sumo.sh
@JefStat

This comment has been minimized.

Copy link
Owner Author

JefStat commented Mar 7, 2017

Ephemeral added
docker container logs added

@ShadySQL

This comment has been minimized.

Copy link

ShadySQL commented Apr 3, 2017

What environment variables did you pass in to your EBS application? I am not able to get this working on my account.

@phekno

This comment has been minimized.

Copy link

phekno commented Nov 15, 2017

It looks like Elastic Beanstalk sets the environment variables some time after it runs the .ebextensions configs, which means setup-sumo just puts empty strings in for the id/key and any Elastic Beanstalk application deploys or scaling events fail.

@dimamix

This comment has been minimized.

Copy link

dimamix commented Nov 23, 2017

One observations from our experience after launching this: Each item in the sources array must also include a name property. Without it, no source was detected or defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.