Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Logstash is different than Kafka

Tags:

How Log stash is different than Kafka? and if both are same which is better? and How?

I found both are the pipelines where one can push the data for further processing.

like image 346
Chandan Gupta Avatar asked Nov 29 '16 11:11

Chandan Gupta


People also ask

What is the difference between Kafka and Elasticsearch?

Kafka is often used as the transport layer, storing and processing data, typically large amounts of data. Kafka stages data before it makes its way to the Elastic Stack. Logstash transforms the data, making it uniform. Elasticsearch serves as long-term, horizontally scalable storage, search, and analysis.

Can Logstash read from Kafka?

The kafka input plugin is a consumer of your kafka topic, you don't need to start other consumers. If Kafka is already running, you only need to start Logstash and it will consume whatever lands into your kafkatest2 topic.

What is the purpose of Logstash?

Logstash is a light-weight, open-source, server-side data processing pipeline that allows you to collect data from a variety of sources, transform it on the fly, and send it to your desired destination. It is most often used as a data pipeline for Elasticsearch, an open-source analytics and search engine.


2 Answers

Kafka is much more powerful than Logstash. For syncing data from such as PostgreSQL to ElasticSearch, Kafka connectors could do the similar work with Logstash.

One key difference is: Kafka is a cluster, while Logstash is basically single instance. You could run multiple Logstash instances. But these Logstash instances are not aware of each other. For example, if one instance goes down, others will not take over its work. Kafka handles the node down automatically. And if you set up Kafka connectors to work in the distributed mode, other connectors could take over the work of the down connector.

Kafka and Logstash could also work together. For example, run a Logstash instance on every node to collect logs, and send the logs to Kafka. Then you could write the Kafka consumer code to do any handling you want.

like image 184
CloudStax Avatar answered Sep 30 '22 22:09

CloudStax


Logstash is a tool that can be used to collect, process and forward events and log messages. Collection is accomplished through a number of input plugins. You can use Kafka as an input plugin, where it will read events from a Kafka topic. Once an input plugin has collected data it can be processed by any number of filters which modify and annotate the event data. Finally events are routed to output plugins which can forward the events to a variety of external programs including Elasticsearch.

Where as Kafka is a messaging software that persists messages, has TTL, and the notion of consumers that pull data out of Kafka. Some of it's usages could be:

  • Stream Processing
  • Website Activity Tracking
  • Metrics Collection and Monitoring
  • Log Aggregation

So simply both of them have their own advantages and disadvantages. But then it depends on your requirements solely.

like image 25
Kulasangar Avatar answered Sep 30 '22 23:09

Kulasangar