<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dyhia REHOUNE on Medium]]></title>
        <description><![CDATA[Stories by Dyhia REHOUNE on Medium]]></description>
        <link>https://medium.com/@drehoune?source=rss-e29aa9d16851------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*StBSjFGdzArYXXPFjansFw.png</url>
            <title>Stories by Dyhia REHOUNE on Medium</title>
            <link>https://medium.com/@drehoune?source=rss-e29aa9d16851------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 05:53:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@drehoune/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building Your First Data Pipeline with ELK]]></title>
            <link>https://medium.com/big-apps-tech/building-your-first-data-pipeline-with-elk-81c54312c9c7?source=rss-e29aa9d16851------2</link>
            <guid isPermaLink="false">https://medium.com/p/81c54312c9c7</guid>
            <category><![CDATA[elk-stack]]></category>
            <category><![CDATA[kibana]]></category>
            <category><![CDATA[logstash]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[Dyhia REHOUNE]]></dc:creator>
            <pubDate>Wed, 08 Apr 2020 12:06:40 GMT</pubDate>
            <atom:updated>2020-04-15T14:07:43.374Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/333/0*EJEapCiF1O5Nm762.png" /></figure><h3>What is the ELK Stack?</h3><p>The ELK platform is a complete log analytics solution, built from a combination of three open source tools -Elasticsearch, Logstash, and Kibana.</p><p>In the ELK stack, Logstash extracts the logging data or other events from different input sources, it processes the events and later stores them in Elasticsearch, and finally, Kibana for powerful and beautiful data visualizations. ELK stack is currently maintained and supported by the company called Elastic (formerly, Elasticsearch).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*w8WILyDL4VyUPQe7OPVjag.png" /></figure><p>Let’s take a brief look at each of these systems:</p><p>· Elasticsearch</p><p>· Logstash</p><p>· Kibana</p><h3>Elasticsearch</h3><p>Elasticsearch is a NoSQL database. It is based on Lucene search engine, and it is built with RESTful API, it offers simple deployment, maximum reliability, and easy management. It also offers advanced queries to perform detailed analyses and stores all the data centrally. It is helpful for executing a quick search of the documents.</p><p>Elasticsearch also allows us to store, search and analyze big volume of data. It is mostly used as the underlying engine<strong> </strong>to power applications that complete search requirements. It has been adopted in search engine platforms for modern web and mobile applications. Apart from a quick search, the tool also offers complex analytics and many advanced features.</p><p>Some of the key features of Elasticsearch are:</p><p>· It is an open source distributed, scalable, and highly available real-time document store</p><p>· It provides real-time search and analysis capabilities</p><p>· It provides a sophisticated RESTful API to play around with lookup, and various features, such as multilingual search, geolocalisation, autocomplete, contextual did-you-mean suggestions, and result snippets</p><p>· It can be scaled horizontally easily and provides easy integrations with cloud-based infrastructures, such as AWS</p><h3>Logstash</h3><p>Logstash is a data pipeline that helps to collect, pars, and analyze a large variety of structured and unstructured data and events generated across various systems, and feeds into the Elasticsearch. It gathers all types of data from different sources and makes them available for us.</p><p>logstash can unify data from various sources and normalize it into a desired target, il allows us to clean and democratize all our data for analytics and visualization purposes.</p><p>It consists of three components:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*BtSnR8EmXmz1geN_GxjoIQ.png" /></figure><p>· <strong>Input: </strong>We<strong> </strong>use inputs to get data into Logstash</p><p>· <strong>Filters:</strong> It is set of conditions to perform a particular action or event. Some useful filters include: grok, mutate, drop, clone, geoip</p><p>· <strong>Output:</strong> It is the final phase of the Logstash pipeline. Some commonly used outputs include: elasticsearch, file, graphite, statsd</p><h3>Kibana</h3><p>Kibana is an open source Apach 2.0 licensed data visualization platform that helps in visualizing any kind of structured and unstructured data stored in Elastecsearch.</p><p>Kibana makes it easy to understand large volumes of data. It simple browser-based interface that allows to quickly create and share dynamic dashboards that display changes to Elasticsearch queries in real time.</p><p>Features of Kinbana:</p><p>· Powerful front-end dashboard which gives us the possibility of visualizing indexed information from the elastic cluster</p><p>· Enables real-time search of indexed information</p><p>· You can search, View, and interact with data stored in Elasticsearch</p><p>· Execute queries on data &amp; visualize results in charts, tables, and maps</p><p>· Configurable dashboard to slice and dice logstash logs in elasticsearch</p><p>· Ability of providing historical data in the form of graphs, charts, etc.</p><p>· Real-time dashboards which is easily configurable</p><p>· Enables real-time search of indexed information</p><h3>ELK Stack installation</h3><p>For my part I use virtualbox in which I have installed Ubuntu 16.04</p><p>Before you start, you must first install Java version 8 . You can use the official Oracle distribution or use the open source version OpenJDK.</p><p>You can verify the Java installation by running the following command in your shell:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*O4yUxH-sZXTN8QyJHRkgbw.png" /></figure><p>If you have verified the java installation in your system, we can proceed with ELK installation:</p><h3>Installation Elasticsearch</h3><p>We will start by installing ElasticSearch. There are different methods to install it but we will use the simplest one, the one based on the use of the Repositories. We start by importing the GPG key from ElasticSearch:</p><pre>wget -qO - <a href="https://artifacts.elastic.co/GPG-KEY-elasticsearch">https://artifacts.elastic.co/GPG-KEY-elasticsearch</a> | sudo apt-key add -</pre><p>Create the Elasticsearch source list:</p><pre>echo “deb <a href="http://packages.elastic.co/elasticsearch/7.x/debian">http://packages.elastic.co/elasticsearch/7.x/debian</a> stable main” | sudo tee -a /etc/apt/sources.list.d/elasticsearch-7.x.list</pre><p>And then all we have to do is to start the installation:</p><pre>sudo apt-get update<br>sudo apt-get –y install elasticsearch</pre><p>Unlike other applications, elastichsearch is neither started automatically at the end of installation neither added to the list of applications launched at startup.</p><p>In order of configuring our system to start ElasticSearch at boot time (Warning, I use here Ubuntu 16.04 which uses systemd so you may have to adapt this command to your system):</p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable elasticsearch.service</pre><p>Before starting ElasticSearch, we will make sure that the server only listens on localhost to prevent anyone from accessing our data from outside. To do this, we will edit the file /etc/elasticsearch/elasticsearch.yml</p><pre>sudo vi /etc/elasticsearch/elasticsearch.yml</pre><p>And look for the line that specifies “network.host ”, we will uncomment it and replace its value with “localhost”</p><pre>network.host: localhost</pre><p>Save and quit.</p><p>Once these changes have been made, we can finally start ElasticSearch</p><pre>sudo systemctl start elasticsearch.service</pre><p>To make sure that the installation has been carried out correctly and that the service is working properly you can call the URL <a href="http://localhost:9200/">http://localhost:9200</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*8mtq-_A9NEH6J1gy-VIyGg.png" /></figure><h3>Installation Logstash</h3><p>Now that we have installed elasticSearch, we will have to fill our database with information from our logs. So we will start by installing logstash:</p><pre>sudo apt-get –y install logstash</pre><p>Then we’ll register the service at startup</p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable logstash.service</pre><p>Next, you will have to create a configuration file to explain to Logstash how to process the data.</p><p>The configuration works in 3 parts, which I will detail in an example:</p><p>· The<strong> input</strong> part, allows you to indicate how the data will enter the pipeline</p><p>· The <strong>filter </strong>part will indicate how to parse and extract the data</p><p>· The <strong>output </strong>part indicates where the data will be sent</p><p>Run Logstash using -e flag, followed by the configuration of standard input and output:</p><pre>cd Logstash-7.6.1<br>./bin/logstash -e ‘input { stdin { } } output { stdout {}</pre><p>Now that Logstash is operational, let’s set up Kibana</p><h3>Installation Kibana</h3><p>First, we’ll update the apt package database, then install Kibana</p><pre>sudo apt-get update<br>sudo apt-get -y install kibana</pre><p>We will then edit the configuration <strong>/etc/kibana/kibana.yml, </strong>in order to not to listen to connections coming from outside</p><pre>network.host: localhost</pre><p>And once this modification has been made we will start the service and save it at startup</p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable kibana.service<br>sudo systemctl start kibana.service</pre><p>If you want to check that kibana is started correctly, just call the URL <a href="http://localhost:5601/">http://localhost:5601</a></p><h3>Example</h3><p>In the previous section, we have familiarized ourselves with each component of the ELK Stack. We made the installations and configurations.</p><p>In this second part, we will build our first master data pipeline using ELK</p><h3>Input dataset</h3><p>For this example, the dataset that we will use here is the Covid-19 dataset I found on Kaggle.</p><p>This dataset can be easily downloaded from the following source:</p><p>“https://www.kaggle.com/michau96/covid-19-east-asia-europe-and-rest-of-world/data”</p><p>The dataset is provided from a csv file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*dhdhp-VDVV48_oegnX2hzA.png" /></figure><p>Now, we will set up the ELK stack where we can analyze and process the data using Logstash, index them in Elasticsearch, and then build visualizations in Kibana.</p><h3>Configuring Logstash</h3><p>Logstash has a rich set of plug-ins for different types of inputs, outputs and filters, which can read, analyze and filter the data according to our needs.</p><p>Let’s configure Logstash:</p><pre>input{<br> file{<br>  path =&gt; &quot;/home/drehoune/elk/covid_19_data.csv<br>  start_position =&gt; &quot;beginning&quot;<br>  }<br> }<br>filter{<br> csv{<br>  columns =&gt; [&quot;SNo&quot;, &quot;ObservationData&quot;, &quot;Province/State&quot;,      &quot;Country/Region&quot;, &quot;Last Update&quot;, &quot;Confirmed&quot;, &quot;Deaths&quot;, &quot;Recovered&quot;]<br>  separator =&gt; &quot;,&quot;<br>  }<br>  <br>  mutate{<br>  couvert =&gt; [&quot;SNo&quot;,&quot;integer&quot;]<br>  couvert =&gt; [&quot;Province/State&quot;,&quot;string&quot;]<br>  couvert =&gt; [&quot;Country/Region&quot;,&quot;string]<br>  couvert =&gt; [&quot;Confirmed&quot;,&quot;integer&quot;]<br>  couvert =&gt; [&quot;Deaths&quot;,&quot;integer&quot;]<br>  couvert =&gt; [&quot;Recovered&quot;,&quot;integer]<br>  }<br>  <br>  date{<br>  match =&gt; [&quot;ObservationData&quot;, MM/dd/yyyy]<br>  target =&gt; &quot;ObservationData&quot;<br>  }<br>  <br>  date{<br>   match =&gt; [&quot;Last Update&quot;, &quot;MM/dd/yyyy HH:mm&quot;]<br>   target =&gt; &quot;Last Update&quot;<br>   }<br>  }<br>output{<br> elasticsearch{<br>  hosts =&gt; &quot;localhost:9200&quot;<br>  index =&gt; &quot;logstash-covid_19_data&quot;<br>  }<br> }</pre><p>We will save this configuration in the /etc/logstash/conf.d/ folder with the name covid_19.conf :</p><pre>sudo -E vim /etc/logstash/conf.d/covid_19.conf</pre><p>Then launch Logstash with this configuration using the following command, but first we’ll check if our configuration has no errors:</p><pre>sudo /usr/share/logstash/bin/logstash --debug --path.settings /etc/logstash -f /etc/logstash/conf.d/covid_19.conf -t</pre><p>Once the configuration is ok:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*E6G2ndEE5pyAOIsj8eLowA.png" /></figure><p>We run logstash:</p><pre>sudo /usr/share/logstash/bin/logstash --debug --path.settings /etc/logstash -f /etc/logstash/conf.d/covid_19.conf</pre><p>Now our ElasticSearch database should be filling up. To verify that the index (logstash-covid_19_data) is correctly created, you can call the REST API provided by Elasticsearch <a href="http://localhost:9200/_cat/indices?v">http://localhost:9200/_cat/indices?v</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*kMKmHWDMLTBgUr2JrKdPRA.png" /></figure><h3>Visualizing with Kibana</h3><p>Now, when you verify that your data is successfully indexed in Elasticsearch, we can go ahead and look at the Kibana interface to get useful analyses of the data according to our needs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*7rABqaC2yw4ANuUGdXN4Qw.png" /></figure><p>Let’s build some basic visualizations from the Kibana visualizations page, and we will use them later in dashboard:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*YD9CTvm1e9mUYfvnWGF4SA.png" /></figure><p>This vertical bar chart represents the max of deaths for each country.</p><p>We will make a dashboard using vizualisations:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*_som7OsoQADf1hpgpAc43w.png" /></figure><h3>Summary:</h3><p>In this article, we have installed and configured ELK stack, we have also seen how to use different input, filtering and output plugins in Logstash to collect, analyze and index data for elastic search, and then use the Kibana Interface to query and view the Elasticsearch indexes. We also built some visualizations, and a dashboard using these visualizations. We managed to build our first data pipeline using ELK Stack.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81c54312c9c7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/big-apps-tech/building-your-first-data-pipeline-with-elk-81c54312c9c7">Building Your First Data Pipeline with ELK</a> was originally published in <a href="https://medium.com/big-apps-tech">Big Apps Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>