Skip to content

gustavohenrique/elasticlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elasticlog

A RESTful API to store and search log data in Elasticsearch

Demo

First, you need to send the log's data to storage in Elasticsearch. You can configure any app to that just making a POST to Elasticlog. You need to configure an Elasticsearch server too and change the hostname variable defined into settings.py file.

Running

git clone <this-repo>
pip install -r requirements.txt
python server.py

You can run using the Docker way:

make build
make docker-run
make fixtures
make run

To send the log's data, just make a POST to the API:

curl -X POST -H 'content-type:application/json' http://`boot2docker ip`/v1/logs/index1 -d '{
    "created_at": "2015-07-30",
    "filename": "connection.py",
    "level": "ERROR",
    "message": "Error connecting to database"
}'

The API can also list all log's data:

# basic usage
curl -H 'content-type:application/json' http://`boot2docker ip`/v1/logs/index1

# pagination support
curl -H 'content-type:application/json' http://`boot2docker ip`/v1/logs/index1?page=1&per_page=5

# order by asc or desc
curl -H 'content-type:application/json' http://`boot2docker ip`/v1/logs/index1?sort=-created_at

# group by level
curl -H 'content-type:application/json' http://`boot2docker ip`/v1/logs/index1?group_by=ERROR

Frontend

There is a web interface to see the log's data.

open http://`boot2docker ip`/html/dist

More

The Marvel plugin is installed into Docker instance. You can access by:

open http://`boot2docker ip`:9200/_plugin/marvel

License

MIT

About

A RESTful API to store and search log data in Elasticsearch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published