|
| 1 | +# lab-opensearch |
| 2 | + |
| 3 | +Lab created to test configuration Filebeat, Logstash, and OpenSearch and OpenSearch stack. |
| 4 | + |
| 5 | +- **Filebeat**: The Filebeat reads the logs line of this file [minimal-lab/filebeat/log/fake-logs.log](mininal-lab/filebeat/log/fake-logs.log) and sends to Logstash; |
| 6 | +- **Logstash**: Receive logs of the filebeat and parse them and forward to OpenSearch; |
| 7 | +- **OpenSearch**: Reveive logs (that in this step, are been named of *Documents*), and stores them in the OpenSearch internal database; |
| 8 | +- **OpenSearch-Dashboards**: Connects in the OpenSearch database through web API and provides friendly web UI console to search de logs/documents. |
| 9 | + |
| 10 | +> :warning: Study and Development's purposes |
| 11 | +>> The tool's configuration does not have SSL or authentication plugins enabled. |
| 12 | +>> This lab was created to test purposes only, don't apply it in your production infrastructure. |
| 13 | +
|
| 14 | +Project directory layout: |
| 15 | + |
| 16 | +```bash |
| 17 | +├── docker-compose.yml # containers config state |
| 18 | +├── filebeat # filebeat container files |
| 19 | +│ ├── Dockerfile # filebeat dockerfile |
| 20 | +│ ├── filebeat.yml # filebeat main config file |
| 21 | +│ └── log # fake log directory (shared like docker volume) |
| 22 | +│ └── *.log # fake logs |
| 23 | +├── logstash # logstash container file |
| 24 | +│ ├── config # logstash config directory |
| 25 | +│ │ ├── logstash.yml # logstash main config file |
| 26 | +│ │ └── pipelines.yml # pipelines manifest file |
| 27 | +│ ├── Dockerfile # logstash Dockerfile |
| 28 | +│ └── pipeline # pipeline directory |
| 29 | +│ └── pipeline-1.cfg # pipeline source code |
| 30 | +├── opensearch # opensearch container config files |
| 31 | +│ ├── Dockerfile # opensearch Dockerfile |
| 32 | +│ └── opensearch.yml # opensearch main config file |
| 33 | +└── opensearch-dashboards # opensearch-dashboards container config files |
| 34 | + ├── Dockerfile # opensearch-dashboards Dockerfile |
| 35 | + └── opensearch_dashboards.yml # opensearch-dashboards main config file |
| 36 | +``` |
| 37 | + |
| 38 | +## How To Run |
| 39 | + |
| 40 | +The lab was created to run over `docker`. To set up container configuration use `docker-compose`. |
| 41 | + |
| 42 | +- To start the environment: |
| 43 | + |
| 44 | +```bash |
| 45 | +$ docker-compose up --build -d |
| 46 | +``` |
| 47 | + |
| 48 | +- To check logs: |
| 49 | + |
| 50 | +```bash |
| 51 | +$ docker-compose logs |
| 52 | +``` |
| 53 | + |
| 54 | +- To destroy stack: |
| 55 | + |
| 56 | +```bash |
| 57 | +$ docker-compose logs |
| 58 | +``` |
| 59 | + |
| 60 | +## How to Access the OpenSearch |
| 61 | + |
| 62 | +The resources can be accessed with the following links: |
| 63 | + |
| 64 | +- OpenSearch Dashboards: http://127.0.0.1:5601/ |
| 65 | +- OpenSearch: http://127.0.0.1:9200/ |
0 commit comments