官术网_书友最值得收藏!

  • Mastering Kibana 6.x
  • Anurag Srivastava
  • 197字
  • 2021-07-16 18:20:11

Outputting the log data into Elasticsearch

The next step is going to be to execute the configuration so that Logstash can start reading logs from the Apache log file. In order to execute the Logstash configuration file, we need to run the following command:

bin/logstash -f /etc/logstash/conf.d/logs-apache.conf

The following screen is showing us the result after executing the preceding command. Once the command is executed successfully, we will get a message, such as Successfully started Logstash API endpoint {:port=>9600}:

When we execute the Logstash configuration, it connects to the output source, which in this case is Elasticsearch. This starts the pipeline so that it reads the data from the log file and puts it into Elasticsearch.

To test this setup, we need to open the browser so that we can open some localhost websites that are served through the Apache server, as this will provide some data for writing to the Apache log file. To test whether the logs have been pushed to Elasticsearch, we can open the Elasticsearch index and check the logs:

http://localhost:9200/logs_apache/_search?pretty

In the preceding screenshot, we can see that Logstash is reading the Apache logs and pushing them to the Elasticsearch server.

主站蜘蛛池模板: 志丹县| 江孜县| 合阳县| 绥棱县| 繁昌县| 临泉县| 汾西县| 曲麻莱县| 南丹县| 宿州市| 湘乡市| 正蓝旗| 资源县| 双城市| 万山特区| 金阳县| 福州市| 桃园市| 泸溪县| 湘潭县| 屏边| 项城市| 礼泉县| 探索| 徐汇区| 高清| 瑞安市| 博白县| 吐鲁番市| 通河县| 井冈山市| 陆川县| 醴陵市| 来宾市| 石首市| 阜宁县| 广昌县| 广州市| 郧西县| 岳西县| 邹城市|