Skip to content

An example of using Monolog and Logstash to write to Elastic

License

Notifications You must be signed in to change notification settings

andybeak/monolog-elk-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo of Monolog / Logstash / Elastic

This project demonstrates connecting your PHP application logs to an ELK stack.

We push logs to a local Logstash instance rather than connecting to Elasticsearch over the network. This allows low latency in our app and sets up a buffer in case Elastic is temporarily unavailable.

Running the project

First set up the project by editing docker/config/logstash/logstash.conf and inserting your AWS details into the output plugin config at the bottom.

Then use these commands:

cd docker
docker-compose up -d
docker exec -it php /bin/bash
composer install

And then visit http://localhost:8000 in your browser. After that you can use Kibana on your instance to view the log.

Logstash will push to your AWS instance, and also to stdout (your docker logs).

Grokking your own logs

These sites are very useful:

Oniguruma lets you use regex in the Grok pattern, like this: (?<field_name>the pattern here)

About

An example of using Monolog and Logstash to write to Elastic

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages