Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orsinium-labs/python-syslog-logstash
Python Logger + RSysLog + Logstash. Demo over docker containers.
https://github.com/orsinium-labs/python-syslog-logstash
django docker docker-compose elasticsearch elk kibana logging logstash python redis rsyslog syslog
Last synced: about 4 hours ago
JSON representation
Python Logger + RSysLog + Logstash. Demo over docker containers.
- Host: GitHub
- URL: https://github.com/orsinium-labs/python-syslog-logstash
- Owner: orsinium-labs
- License: mit
- Created: 2018-04-25T09:10:49.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-11T11:43:01.000Z (over 6 years ago)
- Last Synced: 2024-05-01T15:42:34.980Z (7 months ago)
- Topics: django, docker, docker-compose, elasticsearch, elk, kibana, logging, logstash, python, redis, rsyslog, syslog
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python Syslog Logstash
Demonstration of logging system for Python projects. Fast and safe logs collecting.
## Scheme
1. **Python project** -- sent logs.
1. **Rsyslog** -- collect logs from projects (can be many rsyslogs on many servers).
1. **Redis** -- message queue between rsyslog and logstash.
1. **Logstash** -- retrieve data from Redis, select index and add into ElasticSearch.
1. **ElasticSearch** -- logs storage.
1. **Kibana** -- web-interface.## Usage
1. Run:
```bash
sudo docker-compose up
```
1. Open Kibana: [127.0.0.1:5601/app/kibana](http://127.0.0.1:5601/app/kibana)
1. Go to Management -> Index patterns.
1. Click on "refresh fields". If "create" button still inactive then wait while ElasticSearch is ran.
1. Click "create"
1. Go to "Discover". This is your data :)If you want to see indices then go to "Dev Tools" section and run this command:
```http
GET /_cat/indices
```## Example
Example of one log message from ElasticSearch:
```json
{
"@timestamp": "2018-04-27T12:18:39.199Z",
"@version": "1",
"message": {
"name": "app_name",
"module": "app",
"lineno": 79,
"message": null,
"random_string": "ydrvlhdruj",
"random_integer": 302
},
"facility_label": "user",
"facility": "1",
"hostname": "pythonsysloglogstash_psl-project_1.pythonsysloglogstash_default",
"program": "",
"relayhost": "pythonsysloglogstash_psl-project_1.pythonsysloglogstash_default",
"relayip": "172.21.0.7",
"severity_label": "crit",
"severity": "2",
"tag": "",
"type": "syslog"
}
```