<?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 vikas yadav on Medium]]></title>
        <description><![CDATA[Stories by vikas yadav on Medium]]></description>
        <link>https://medium.com/@vikas.yadav3785?source=rss-baf09dd15079------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*jYM7qokdfPsd5mHxDFfALw@2x.jpeg</url>
            <title>Stories by vikas yadav on Medium</title>
            <link>https://medium.com/@vikas.yadav3785?source=rss-baf09dd15079------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 11:21:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vikas.yadav3785/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[Cost Optimization in Public Cloud]]></title>
            <link>https://medium.com/devops-dudes/cost-optimization-in-public-cloud-cc25bab74e95?source=rss-baf09dd15079------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc25bab74e95</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[cloud-finops]]></category>
            <category><![CDATA[cloud-cost-optimization]]></category>
            <category><![CDATA[cloud-cost-management]]></category>
            <dc:creator><![CDATA[vikas yadav]]></dc:creator>
            <pubDate>Wed, 13 Sep 2023 04:25:17 GMT</pubDate>
            <atom:updated>2023-09-14T00:01:07.960Z</atom:updated>
            <content:encoded><![CDATA[<p>11 Strategies to Prevent Bill Shock</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2eP88q7U8uoti6xo" /><figcaption>Photo by <a href="https://unsplash.com/@homajob?utm_source=medium&amp;utm_medium=referral">Scott Graham</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Introduction</p><p>Cloud computing has picked up in recent years and is the place where everyone is or wants to be, The number of customers migrating from on-premise to public cloud be it Amazon Web Services, Azure or Google Cloud Platform is increasing everyone However in the hurry to move to cloud one thing that gets missed our and results in “Bill Shock” very often is that design considerations for cloud are different to design consideration for On-premise.</p><p>One such example is that in a data center environment, you buy or lease some rack space, servers, power and cooling equipment etc. and you can use it as you wish however in cloud computing with its pay-as-you-go subscription billing you basically pay for every resource you use except the “always free” resources.</p><p>Also, the cloud provides you with features such as auto-scaling which were not available in the traditional data centre environment(s).</p><p>As a result, Cost should be considered early on in the planning phase whether you are planning for a migration or designing something to be developed and run in the cloud.</p><p>In this article, I talk about the various strategies that I have used over the years to save my customers precious dollars when they run their workloads in the cloud.</p><h3>Preliminary</h3><p>Before you embark on the journey to reduce your cloud operational costs, you need to make sure the correct process/forum such as a cloud centre of excellence, a program steering committee, an architecture review board etc. is available for you to escalate any cost optimization opportunities for the stakeholder(s) to make decisions on, here is a list of items that you should include in your presentation to the stakeholders ( you might tweak this based on your needs)</p><ul><li>Current State — What is your current state design</li><li>Target State — What is your target state design</li><li>Benefits/Risks — A comparison of benefits of the approach vs. clear documentation of risks</li><li>Current and target costs using cloud providers’ Pricing calculators such as the <a href="https://calculator.aws/#/">AWS pricing calculator</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*j27_ruWe0u9-D2nI" /><figcaption>Photo by <a href="https://unsplash.com/@kaleidico?utm_source=medium&amp;utm_medium=referral">Kaleidico</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>The Strategies</h3><ol><li><strong>Waste removal: </strong>Identify and remove waste early in the migration for example</li></ol><ul><li><strong>Retire applications</strong>: Identifying and retiring applications early in the migration process is essential and should be carried out while workloads are being migrated.</li><li>Identify, evaluate and eliminate <strong><em>Overprovisioned resources, Idle resources, Unused resources</em></strong></li></ul><p><strong>2. License reduction: </strong>Reduce license utilization thereby reducing license costs for example moving perpetual product licenses to cloud-native pay-as-you-go licenses can save costs as you only for the license when you use the resource.</p><p><strong>3. Storage cost optimization: </strong>Storage costs can be reduced by assessing the storage needs and choosing the appropriate storage type and performance requirements</p><ul><li>Offloaded data to cheaper storage where possible for example Moving large objects from the database to Amazon Simple Storage Service (S3) can assist in reducing storage costs.</li><li>Where possible utilize newer storage types for block storage</li><li>Assess IOPS requirements where possible and provision correct storage based on IOPS as higher IOPS generally comes at a higher cost.</li></ul><p><strong>4. Right-Sizing: </strong>Right size the workloads to avoid wasted capacity however there are some pre-requisites</p><ul><li>Identify what performance metrics will used to make decisions such as CPU, memory, number of concurrent users etc.</li><li>Identify and deploy the correct tool to measure performance metrics</li><li>Identify the duration that should be considered to track performance to cater for things like seasonal workloads</li></ul><p><strong>5. Usage reservations: </strong>Commitments for the usage of specific compute or instances allow discounted prices, for example, Amazon provides the following options broadly at the time of writing this article</p><ul><li>Reserve instances ( Standard, Convertible, Scheduled )</li><li>Savings Plan ( Compute savings plan, Ec2 Instance savings plan)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OIs09oICa0KdcafJ" /><figcaption>Photo by <a href="https://unsplash.com/@jasongoodman_youxventures?utm_source=medium&amp;utm_medium=referral">Jason Goodman</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>6. Optimize compute: </strong>Optimize compute while designing for the cloud for example newer processor types such as graviton-based processors are cheaper to run than older processor types.</p><p><strong>7. Operational efficiencies to bring overall TCO down </strong>Operational efficiencies can help reduce the overall time/effort for a task and thereby reduce the overall run costs for example, some developers snapshot their database on-premise and use that snapshot provision another database to develop against, this practice will result in an additional cost for Cloud-native PaaS database like Amazon Relational database service. These practices should be identified and worked upon to bring down operational costs.</p><p><strong>8. Life Cycle Management on resources: </strong>One of the clearest paths to cost savings is through optimizing your resource costs based on the frequency of access and performance needs for example most object storage products from cloud vendor(s) like Amazon Simple Storage Service(S3) have the ability to use lifecycle rules to</p><ul><li>Delete data when it is not needed</li><li>Move data to cheaper tiers such as the archival storage tier based on age or frequency of access.</li></ul><p><strong>9. Match capacity with demand: </strong>Where possible, matching capacity with demand reduces wasted capacity during the lean periods For example, using autoscaling groups will help you scale back compute when not needed and scale out when needed which allows you to pay only when compute is needed.</p><p><strong>10. Non-critical workload scheduling: </strong>If a non-critical workload is scheduled to shut down after hours or reduced in capacity when not needed, it has a direct impact on operational run costs, Non-critical workloads include</p><ul><li>A non-production environment like Test/QA etc.</li><li>Non-critical production environment</li></ul><p><strong>11. Refactor for cost optimization</strong>: Most applications designed to work in a data centre environment are built with different design considerations than those of a cloud environment For example auto-scaling is generally not a thing in data centre environments(with some exceptions), fine-tuning the service to work in the cloud has inherent benefits as the service is more tightly integrated with its new environment and may bring in significant cost savings.</p><h3>Summary</h3><p>The Design considerations for cloud computing and data center environments are different and therefore a shift is needed in how workloads and services are designed to run in the cloud for optimal consumption costs. Moreover, some migration techniques such as “Lift and Shift” migration(s) where speed of migration is prioritized over optimization can provision resources in the public cloud where there are wasted costs.</p><p>I have tried to document the strategies that I have seen help me optimize the operational costs for my customers in public cloud environments over time, If you have seen a strategy that I have not listed here please feel free to let me know and I will update this blog post.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc25bab74e95" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-dudes/cost-optimization-in-public-cloud-cc25bab74e95">Cost Optimization in Public Cloud</a> was originally published in <a href="https://medium.com/devops-dudes">DevOps Dudes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elasticsearch 8.x Deployment]]></title>
            <link>https://medium.com/devops-dudes/elasticsearch-8-x-deployment-ac990b9e4c56?source=rss-baf09dd15079------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac990b9e4c56</guid>
            <category><![CDATA[elk-stack]]></category>
            <category><![CDATA[elastic]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[elastic-stack]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[vikas yadav]]></dc:creator>
            <pubDate>Mon, 21 Feb 2022 15:25:37 GMT</pubDate>
            <atom:updated>2022-07-29T05:27:54.780Z</atom:updated>
            <content:encoded><![CDATA[<h3>What changed?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/0*fTZkRM2erh0iNc38.png" /></figure><p>Elasticsearch recently release version 8.0 and it came with some cool new features such as</p><ol><li><em>k-nearest neighbor</em> (kNN) search</li><li>Storage savings for keyword, match_only_text, and text fields</li><li>Faster indexing of geo_point, geo_shape, and range fields</li><li>PyTorch model support for natural language processing (NLP)</li></ol><p>You can read more about these <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/release-highlights.html">here</a>.</p><p>In this article, I&#39;ll focus on how the deployment has changed and</p><blockquote>The biggest takeaway is that security features are enabled and configured by default in version 8.x</blockquote><p>We’ll deploy a single-node cluster in this article and I<a href="https://www.youtube.com/watch?v=W7V3OTbFbkI&amp;t=4s"> have used a free tier GCP VM instance</a> to deploy my elastic search cluster, if you need to know how to do this, please follow these two videos on my youtube channel to setup your lab</p><ul><li><a href="https://www.youtube.com/watch?v=rdBe1QSYeig&amp;t=1s"><em>How to configure a new VPC network in the google cloud platform</em></a></li><li><a href="https://www.youtube.com/watch?v=naQJiUv_AQE">How to create VM instances in GCP using instance templates</a></li></ul><p>With our lab VM setup, let’s deploy our elastic search v8.x demo system</p><ol><li>Update System</li></ol><pre>sudo apt-get update</pre><p>2. Install <strong><em>wget</em></strong> if it is not on the system</p><pre>sudo apt-get install wget -y</pre><p>3. Download and install elasticsearch public signing key</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>4. Install <strong><em>apt-transport-https</em></strong> package</p><pre>sudo apt-get install apt-transport-https -y</pre><p>5. Save directory definitions — I’ve highlighted the change in URL for 8.x</p><pre>echo “deb <a href="https://artifacts.elastic.co/packages/8.x/apt">https://artifacts.elastic.co/packages/8.x/apt</a> stable main” | sudo tee -a /etc/apt/sources.list.d/<strong>elastic-8.x</strong>.list</pre><p>6. Update and Install Elasticsearch and Kibana</p><pre>sudo apt-get update &amp;&amp; sudo apt-get install elasticsearch &amp;&amp; sudo apt-get install kibana</pre><p>In the deployment logs, you will see the following log lines, firstly, you will see that elastic search built-in superuser <strong>elastic </strong>is created by default, and next you will see the superuser password which you need to store for future use.</p><pre><strong>Creating elasticsearch group… OK<br>Creating elasticsearch user… OK</strong><br>Unpacking elasticsearch (8.0.0) …<br>Setting up elasticsearch (8.0.0) …<br> — — — — —- Security autoconfiguration information — — — — — — — — — </pre><pre>Authentication and authorization are enabled.<br>TLS for the transport and HTTP layers is enabled and configured.</pre><pre>The generated password for the elastic built-in superuser is : <strong>5aKNDmXUOVu9P*Ne_5rS</strong></pre><pre>If this node should join an existing cluster, you can reconfigure this with<br>‘/usr/share/elasticsearch/bin/elasticsearch-reconfigure-node — enrollment-token &lt;token-here&gt;’<br>after creating an enrollment token on your existing cluster.</pre><pre>You can complete the following actions at any time:</pre><pre>Reset the password of the elastic built-in superuser with <br>‘/usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic’.</pre><pre>Generate an enrollment token for Kibana instances with <br> ‘/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana’.</pre><pre>Generate an enrollment token for Elasticsearch nodes with <br>‘/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node’.</pre><pre> — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — -</pre><p>This log output also shows some commands that might be of interest such as</p><ul><li><em>How to reset elastic built-in user password</em></li><li><em>How to generate enrollment tokens</em></li></ul><p>7. Elasticsearch configuration directory contents</p><p>If you cd into the directory for elastic search configuration which is by default <strong><em>/etc/elasticsearch</em></strong><em>,</em> you will see an entry for a <strong><em>certs</em></strong> directory and a <strong>Keystore</strong><em>,</em> if you <strong>cd</strong> into <strong><em>certs</em></strong> directory you will notice that it has the following certificates</p><ul><li><strong>http_ca.crt</strong>: This is the self-signed ca certificate for elastic search</li><li><strong>http.p12</strong>: This is the certificate that is used to encrypt client communication such as communication between Kibana and elastic search.</li><li><strong>transport.p12</strong>: This is the certificate that is used to encrypt cluster communications.</li></ul><p>Next, elastic search Keystore is used to store secrets information for example your p12 passwords, you can look at the contents of the Keystore by using the following command</p><pre>/usr/share/elasticsearch/bin/elasticsearch-keystore list</pre><pre>## You will get the following information </pre><pre>autoconfiguration.password_hash<br>keystore.seed<br>xpack.security.http.ssl.keystore.secure_password<br>xpack.security.transport.ssl.keystore.secure_password<br>xpack.security.transport.ssl.truststore.secure_password</pre><p>To view any secret for example the password to open my <strong><em>http.p12</em></strong> file, type the following command</p><pre>root@elk-1:/etc/elasticsearch/certs# /usr/share/elasticsearch/bin/elasticsearch-keystore show xpack.security.http.ssl.keystore.secure_password</pre><p>To open the <strong><em>http.p12</em></strong> file and look at its contents you can type</p><pre>openssl pkcs12 -nokeys -info -in /etc/elasticsearch/certs/http.p12 </pre><p>When prompted for an import password, type in the password that you got from Keystore.</p><blockquote><strong>For production cluster deployments you might need to replace ca and HTTP and transport certificates depending on your organization’s security policy </strong>with those from your enterprise CA but if this is just a lab system default self-signed certifcates are fine.</blockquote><p>8. Next, let&#39;s have a look at the configuration file for our cluster</p><pre>sudo su</pre><pre>nano /etc/elasticsearch/elasticsearch.yml</pre><pre> # change cluster name</pre><pre>cluster.name: demo-elk</pre><pre> # give the cluster a descriptive name</pre><pre>node.name: elk-1</pre><pre># change network binding</pre><pre>network.host: 0.0.0.0</pre><p>The section above is similar to how a v7.x cluster is configured but in the same elasticsearch.yml file towards the bottom you will see the following section</p><pre># — — — — — — — BEGIN SECURITY AUTO CONFIGURATION — — — — — — — —<br>#<br># The following settings, TLS certificates, and keys have been automatically <br># generated to configure Elasticsearch security features on 21–02–2022 13:58:48<br>#<br># — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</pre><pre># Enable security features<br>xpack.security.enabled: true</pre><pre>xpack.security.enrollment.enabled: true</pre><pre># Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents<br>xpack.security.http.ssl:<br> enabled: true<br> keystore.path: certs/http.p12</pre><pre># Enable encryption and mutual authentication between cluster nodes<br>xpack.security.transport.ssl:<br> enabled: true<br> verification_mode: certificate<br> keystore.path: certs/transport.p12<br> truststore.path: certs/transport.p12<br># Create a new cluster with the current node only<br># Additional nodes can still join the cluster later<br>cluster.initial_master_nodes: [“elk-1”]</pre><pre># Allow HTTP API connections from localhost and local networks<br># Connections are encrypted and require user authentication<br>http.host: [_local_, _site_]</pre><pre># Allow other nodes to join the cluster from localhost and local networks<br># Connections are encrypted and mutually authenticated<br>#transport.host: [_local_, _site_]</pre><pre># — — — — — — END SECURITY AUTO CONFIGURATION — — — — — — — — — — —</pre><p>Now, the section of elasticsearch.yml above has some key configurations that I will explain here</p><p>First, you can see <strong><em>x-pack security is enabled by default</em></strong> using this line in the elasticsearch.yml file, you can also see that security enrollments are enabled as well</p><pre>xpack.security.enabled: true</pre><pre>xpack.security.enrollment.enabled: true</pre><p>Secondly, you will see that is<strong><em> certificates to be used for encryption with API clients such as Kibana, Logstash, are stored in http.p12 file</em></strong></p><pre>xpack.security.http.ssl:<br> enabled: true<br> keystore.path: certs/http.p12</pre><p>Thirdly, the following code instructs the system that <strong><em>cluster communication is encrypted</em></strong> and the relevant certificates can be found in <strong>certs/transport.p12</strong></p><pre>xpack.security.transport.ssl:<br> enabled: true<br> verification_mode: certificate<br> keystore.path: certs/transport.p12<br> truststore.path: certs/transport.p12</pre><p>Next, we provide a<strong><em> static set of initial master nodes </em></strong><em>which is by default only this node but if you are setting up a cluster you will edit this entry to include other initial master nodes.</em></p><pre>cluster.initial_master_nodes: [“elk-1”]</pre><p>Lastly, we specify which <strong>networks</strong> are <strong>HTTP and cluster communication allowed </strong>on</p><pre># Allow HTTP API connections from localhost and local networks<br># Connections are encrypted and require user authentication<br>http.host: [_local_, _site_]</pre><pre># Allow other nodes to join the cluster from localhost and local networks<br># Connections are encrypted and mutually authenticated<br>#transport.host: [_local_, _site_]</pre><p>We will not make any changes to this section for our demo in this article.</p><p>8. Start Elasticsearch service</p><pre>sudo systemctl start elasticsearch</pre><p>9. Validate Elasticsearch cluster health</p><pre>curl -k -u elastic:&lt;password&gt; <a href="https://localhost:9200/_cluster/health?pretty">https://localhost:9200/_cluster/health?pretty</a> </pre><pre>## -k to ignore ssl verification, if you are providing enterprise certificates you can remove it.</pre><p>10. Next we need to set a password for the kibana_system user as we will need this information for communication between elastic search and Kibana</p><pre>/usr/share/elasticsearch/bin/elasticsearch-reset-password -u kibana</pre><p>11. Configure Kibana</p><pre>nano /etc/kibana/kibana.yml</pre><pre>## uncomment server.port</pre><pre>server.port: 5601</pre><pre>## server base url however this needs to be corrected everytime you start and stop the server</pre><pre>server.publicBaseUrl: “http://&lt;hostname_or_ip_address&gt;:5601/&quot;</pre><pre>## change server.host</pre><pre>server.host: “0.0.0.0”</pre><pre>## change server.name</pre><pre>server.name: “demo-kibana”</pre><pre><strong>## uncomment elasticsearch.host</strong></pre><pre>elasticsearch.hosts: [“http<strong>s</strong>://localhost:9200&quot;]</pre><pre><strong>## add kibana_system user credentials</strong></pre><pre>elasticsearch.username: &quot;kibana_system&quot;<br>elasticsearch.password: &quot;&lt;your_kibana_system_user_password&gt;&quot;</pre><p>12. Start Kibana service</p><pre>systemctl start kibana</pre><p>13. Enable elastic search and Kibana</p><pre>systemctl enable elasticsearch</pre><pre>systemctl enable kibana</pre><p>Open Kibana by typing in the IP address of your elk and port 5601</p><pre>https:\\&lt;&lt;ip_address&gt;&gt;:5601</pre><p>and it should display the home page for Kibana.</p><p>If you enjoyed reading this article, please clap and follow me on medium.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac990b9e4c56" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-dudes/elasticsearch-8-x-deployment-ac990b9e4c56">Elasticsearch 8.x Deployment</a> was originally published in <a href="https://medium.com/devops-dudes">DevOps Dudes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with Packetbeat]]></title>
            <link>https://medium.com/devops-dudes/getting-started-with-packetbeat-fce4f9c9d1ae?source=rss-baf09dd15079------2</link>
            <guid isPermaLink="false">https://medium.com/p/fce4f9c9d1ae</guid>
            <category><![CDATA[elastic-stack]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[secdevops]]></category>
            <category><![CDATA[packetbeat]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[vikas yadav]]></dc:creator>
            <pubDate>Sat, 31 Jul 2021 16:18:34 GMT</pubDate>
            <atom:updated>2021-07-31T18:25:41.246Z</atom:updated>
            <content:encoded><![CDATA[<p>Monitoring your network traffic using Elasticsearch</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Flm7FevNfzD3MoF9" /><figcaption>Photo by <a href="https://unsplash.com/@tvick?utm_source=medium&amp;utm_medium=referral">Taylor Vick</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Packetbeat is a real-time network packet analyzer that you can use with Elasticsearch to provide an <em>application monitoring and performance analytics system.</em></blockquote><p>Packetbeat works by capturing the network traffic between your application servers, decoding the application layer protocols (HTTP, MySQL, Redis, and so on).</p><p>Packetbeat can run on —</p><ul><li>the same servers as your application processes or</li><li>on its own servers.</li></ul><h3>Lab Setup</h3><p>In this article, We’ll need a single-node elastic search cluster(<a href="https://medium.com/devops-dudes/how-to-deploy-elasticsearch-5b1105e3063a?sk=f51f2760e6af13954fad256adea42035">refer to this article</a> for instructions) and two apache webservers. I have used the GCP platform to build my test lab since it offers $300 USD free trial credit but you can do it on your servers or any other public cloud platform as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/0*gmJ_QMqb-Uo8bKDu.jpeg" /></figure><h3>Packetbeat Installation</h3><p>Note: You’ll need an existing elastic search cluster to store log data and Kibana to visualize this data. We will also need metric beat installed on this server.</p><ol><li><a href="https://medium.com/@vikas.yadav3785/how-to-deploy-elasticsearch-5b1105e3063a">Please read this article to help set up a single-node elastic search instance and Kibana</a>.</li><li><a href="https://medium.com/devops-dudes/getting-started-with-metricbeat-7c5718e6b3f4?sk=03b112610d7f68f9bef13037d1fd5fc3">Please read this article to help set up the metric beat.</a></li></ol><p>We’ll use the APT repository method to install Packetbeat.</p><h4><strong>Installation and configuration of Packetbeat on web Server</strong></h4><ol><li><strong>Install Packetbeat</strong></li></ol><pre>sudo apt-get install packetbeat</pre><p><strong>2. Configure Metribeat</strong></p><pre>sudo su</pre><pre>cd /etc/packetbeat</pre><pre>nano packetbeat.yml</pre><pre>packetbeat.interfaces.device: any</pre><pre># comment out unecessary protocols</pre><pre>tags: [“web-tier”]</pre><pre>setup.dashboards.enabled: true</pre><pre>host: “192.168.1.34:5601”</pre><pre>output.elasticsearch:</pre><pre># Array of hosts to connect to.</pre><pre>hosts: [“192.168.1.34:9200”]</pre><pre># Protocol — either `http` (default) or `https`.</pre><pre>protocol: “http”</pre><pre># Authentication credentials — either API key or username/password.</pre><pre>#api_key: “id:api_key”</pre><pre>username: “elastic”</pre><pre>password: “goodwitch”</pre><p><strong>3. Start Packetbeat</strong></p><pre>sudo systemctl start packetbeat</pre><p><strong>4. Enable beat-pack if not already enabled</strong></p><pre>sudo metricbeat modules enable beat-xpack</pre><p><strong>5. configure beat-expack</strong></p><pre>sudo nano /etc/metricbeat/modules.d/beat-xpack.yml</pre><pre>hosts: [“http://localhost:5070&quot;]</pre><pre>username: “beats_system”</pre><pre>password: “avatar”</pre><p><strong>6. Validate Metricbeat service is running</strong></p><pre>systemctl status metricbeat</pre><p><strong>7. Stack monitoring and dashboards</strong></p><p>If your packetbeat service has been successfully deployed and configured, you should be able to see heartbeat come up under stack monitoring-&gt; Beats</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0DMpRJ7Y2lyh01aH_GC0HQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JmiDOtmvGCQsrnBJKR0jYg.png" /></figure><p>Finally, you can go to dashboards and check one of the pre-built dashboards for Packetbeat</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/0*iSvRoUne6Z1WIoiA.png" /></figure><p>So, here’s how you can configure audit beat to monitor your users and processes.</p><p>If you want to do some hands-on practice on Elaticsearch, <a href="http://single-node%20elasticsearch%20cluster/">here is the link to my youtube playlist where I show you how to can set up a lab setup with 2 apache servers feeding data to a single-node Elasticsearch cluster deployed on a google cloud platform or GCP.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fce4f9c9d1ae" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-dudes/getting-started-with-packetbeat-fce4f9c9d1ae">Getting started with Packetbeat</a> was originally published in <a href="https://medium.com/devops-dudes">DevOps Dudes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with HeartBeat]]></title>
            <link>https://medium.com/devops-dudes/getting-started-with-heartbeat-a9c23fbe1c80?source=rss-baf09dd15079------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9c23fbe1c80</guid>
            <category><![CDATA[elastic-stack]]></category>
            <category><![CDATA[secdevops]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[heartbeat-monitor]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[vikas yadav]]></dc:creator>
            <pubDate>Sat, 31 Jul 2021 15:56:11 GMT</pubDate>
            <atom:updated>2021-07-31T18:25:07.785Z</atom:updated>
            <content:encoded><![CDATA[<p>Monitor uptime for your applications and servers</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*haAtrvy9qZMSn-o-" /><figcaption>Photo by <a href="https://unsplash.com/@chrisliverani?utm_source=medium&amp;utm_medium=referral">Chris Liverani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Heartbeat is a lightweight shipper that can periodically check the status of your services and determine whether they are available.</blockquote><p>Heartbeat currently supports monitors for checking hosts via:</p><ul><li><strong><em>ICMP (v4 and v6) Echo Requests</em></strong>. Use the icmp monitor when you simply want to check whether a service is available. This monitor requires root access.</li><li><strong><em>TCP.</em></strong> Use the tcp monitor to connect via TCP. You can optionally configure this monitor to verify the endpoint by sending and/or receiving a custom payload.</li><li><strong><em>HTTP. </em></strong>Use the http monitor to connect via HTTP. You can optionally configure this monitor to verify that the service returns the expected response, such as a specific status code, response header, or content.</li></ul><h3>Lab Setup</h3><p>In this article, We’ll need a single-node elastic search cluster(<a href="https://medium.com/devops-dudes/how-to-deploy-elasticsearch-5b1105e3063a?sk=f51f2760e6af13954fad256adea42035">refer to this article</a> for instructions) and two apache webservers. I have used the GCP platform to build my test lab since it offers $300 USD free trial credit but you can do it on your servers or any other public cloud platform as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/0*_Cpv8kXXYiOum1_s.jpeg" /></figure><h3>Heartbeat Installation</h3><p>Note: You’ll need an existing elastic search cluster to store log data and Kibana to visualize this data. We will also need metric beat installed on this server.</p><ol><li><a href="https://medium.com/@vikas.yadav3785/how-to-deploy-elasticsearch-5b1105e3063a">Please read this article to help set up a single-node elastic search instance and Kibana</a>.</li><li><a href="https://medium.com/devops-dudes/getting-started-with-metricbeat-7c5718e6b3f4?sk=03b112610d7f68f9bef13037d1fd5fc3">Please read this article to help set up the metric beat.</a></li></ol><p>We’ll use the APT repository method to install Heartbeat.</p><h4><strong>Installation and configuration of heartbeat on ELK Server</strong></h4><ol><li><strong>Install heartbeat</strong></li></ol><pre>sudo apt-get update &amp;&amp; sudo apt-get install heartbeat-elastic</pre><p><strong>2. Configure heartbeat</strong></p><pre>sudo nano /etc/heartbeat/heartbeat.yml</pre><pre><strong>### Live Reloadding</strong></pre><pre>reload.enabled: true</pre><pre>reload.period: 5s</pre><pre><strong>### Kibana</strong></pre><pre>host: “localhost:5601”</pre><pre><strong>### elasticsearch output</strong></pre><pre>hosts: [“localhost:9200”]</pre><pre>protocol: “http”</pre><pre>username: “elastic”</pre><pre>password: “goodwitch”</pre><pre><strong>### logging.to_files: true</strong></pre><pre>logging.level: info</pre><pre>logging.to_files: true</pre><pre>logging.files:</pre><pre>path: /var/log/heartbeat</pre><pre>name: heartbeat</pre><pre>keepfiles: 7</pre><pre>permissions: 0644</pre><pre><strong>### setup monitoring through metricbeat</strong></pre><pre>http.enabled: true</pre><pre>http.port: 5069</pre><p><strong>3. Enable beat-pack if not already enabled</strong></p><pre>sudo metricbeat modules enable beat-xpack</pre><p><strong>4. configure beat-expack</strong></p><pre>sudo nano /etc/metricbeat/modules.d/beat-xpack.yml</pre><pre>hosts: [“http://localhost:5069&quot;]</pre><pre>username: “beats_system”</pre><pre>password: “avatar”</pre><p><strong>5. Validate metricbeat service is running</strong></p><pre>systemctl status metricbeat</pre><p><strong>6. start heartbeat</strong></p><pre>systemctl start heartbeat-elastic</pre><p><strong>7. configure monitors</strong></p><pre>cp sample.icmp.yml.disabled icmp.yml</pre><pre>cp sample.http.yml.disabled http.yml</pre><pre>cp sample.tcp.yml.disabled tcp.yml</pre><p><strong>7.1 ICMP monitor</strong></p><pre>id: icmp-status</pre><pre>name: icmp status check</pre><pre>enabled: true</pre><pre>hosts: [“192.168.2.19”, “35.197.123.189”]</pre><pre>tags: [“web-tier”]</pre><p><strong>7.2 http monitor</strong></p><pre>id: web-status</pre><pre>name: web status check</pre><pre>enabled: true</pre><pre>enabled: true</pre><pre>hosts: [“http://localhost:9200&quot;, “http://localhost:5601&quot;]</pre><pre>username: ‘elastic’</pre><pre>password: ‘goodwitch’</pre><pre>tags: [“elk”]</pre><p><strong>7.3 tcp monitor</strong></p><pre>id: ssh-status</pre><pre>name: ssh status check</pre><pre>enabled: true</pre><pre>hosts: [“192.168.2.19:22”]</pre><p><strong>8. Stack monitoring</strong></p><p>If your heartbeat service has been successfully deployed and configured, you should be able to see heartbeat come up under stack monitoring-&gt; Beats</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/0*I9mkKQx-HWKCfjgS.png" /></figure><p><strong>11. Dashboards</strong></p><p>Finally, you can go to dashboards and check one of the pre-built dashboards for heartbeat</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bPu5bsH2NloJ2lfd.png" /></figure><p>So, here’s how you can configure audit beat to monitor your users and processes.</p><p>If you want to do some hands-on practice on Elaticsearch, <a href="http://single-node%20elasticsearch%20cluster/">here is the link to my youtube playlist where I show you how to can set up a lab setup with 2 apache servers feeding data to a single-node Elasticsearch cluster deployed on a google cloud platform or GCP.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9c23fbe1c80" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-dudes/getting-started-with-heartbeat-a9c23fbe1c80">Getting started with HeartBeat</a> was originally published in <a href="https://medium.com/devops-dudes">DevOps Dudes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with Auditbeat]]></title>
            <link>https://medium.com/devops-dudes/getting-started-with-auditbeat-c080e2516fcd?source=rss-baf09dd15079------2</link>
            <guid isPermaLink="false">https://medium.com/p/c080e2516fcd</guid>
            <category><![CDATA[secdevops]]></category>
            <category><![CDATA[elastic-stack]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[audit-beat]]></category>
            <dc:creator><![CDATA[vikas yadav]]></dc:creator>
            <pubDate>Sat, 31 Jul 2021 15:15:07 GMT</pubDate>
            <atom:updated>2021-07-31T18:24:24.463Z</atom:updated>
            <content:encoded><![CDATA[<p>Storing and analyzing audit data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Bl9Asp--lXE_2ZUE" /><figcaption>Photo by <a href="https://unsplash.com/@homajob?utm_source=medium&amp;utm_medium=referral">Scott Graham</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Auditbeat allows you to monitor user activity and processes and analyze your event data in the Elastic Stack without touching auditd. Audit beat communicates directly with the Linux audit framework, collects the same data as auditd, and sends the events to the Elastic Stack in real time.</blockquote><p>It is a lightweight shipper that can help detect changes to critical files, and identify potential security policy violations.</p><p>Auditbeat has various modules and I will discuss the three most common modules in this article</p><ol><li>Auditd</li><li>File Integrity</li><li>System</li></ol><h4>Auditd Module</h4><ul><li>auditd module receives audit events from the Linux Audit Framework that is a part of the Linux kernel(Only available for Linux).</li><li>It establishes a subscription to the kernel to receive the events as they occur ( period configuration is unused).</li><li>Might need to stop other services such auditd/journald</li><li><strong><em>File System rule</em></strong> —<em> file watches, allow the auditing of access to a particular file or a directory.</em></li></ul><pre> w <em>path_to_file</em> -p <em>permissions</em> -k <em>key_name<br> <br> Permission: rwxa</em></pre><ul><li><strong><em>System call rule </em></strong><em>— allow logging of system calls that any specified program makes</em></li></ul><pre><em>-a action,filter -S system_call -F field=value -k key_name</em></pre><pre>Action: always/never</pre><pre>Filter: task, exit, user, and exclude</pre><pre><em>system_call</em> specifies the system call by its name</pre><pre><em>field</em>=<em>value</em> specifies additional options that furthermore modify the rule to match events based on a specified architecture, group ID, process ID, and others.</pre><h4><strong>File integrity module</strong></h4><ul><li>file_integrity module sends events when a file is changed (created, updated, or deleted) on a disk. The events contain file metadata and hashes.</li><li>creates a subscription with the OS to receive notifications of changes to the specified files or directories. Upon receiving notification of a change the module will read the file’s metadata and compute a hash of the file’s contents.</li><li>At startup this module will perform an initial scan of the configured files and directories to generate baseline data for the monitored paths and detect changes since the last time it was run. It uses locally persisted data in order to only send events for new or modified files.</li></ul><h4><strong>System Module</strong></h4><ul><li>The system module collects various security-related information about a system. All datasets send both periodic state information (e.g. all currently running processes) and real-time changes (e.g. when a new process starts or stops).</li><li>Each dataset sends two kinds of information: state and events</li><li>State information is sent periodically and (for some datasets) on startup.</li><li>frequency of state updates can be controlled for all datasets using the <em>state.period</em></li><li>Event information is sent as the events occur (e.g. a process starts or stops).</li><li>All datasets are currently using a poll model to retrieve their data. The frequency of these polls is controlled by the period configuration parameter</li></ul><h4><strong>Lab Setup</strong></h4><p>In this article, we’ll need a single-node elastic search cluster(<a href="https://medium.com/devops-dudes/how-to-deploy-elasticsearch-5b1105e3063a?sk=f51f2760e6af13954fad256adea42035">refer to this article</a> for instructions) and two apache webservers. I have used the GCP platform to build my test lab since it offers $300 USD free trial credit but you can do it on your servers or any other public cloud platform as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/0*yhH8I2mo6DVxqxsg.jpeg" /></figure><h4>Auditbeat Installation</h4><p>Note: You’ll need an existing elastic search cluster to store log data and Kibana to visualize this data. We will also need metric beat and filebeat installed on this server.</p><ol><li><a href="https://medium.com/@vikas.yadav3785/how-to-deploy-elasticsearch-5b1105e3063a">Please read this article to help set up a single-node elastic search instance and Kibana</a>.</li><li><a href="https://medium.com/devops-dudes/getting-started-with-metricbeat-7c5718e6b3f4?sk=03b112610d7f68f9bef13037d1fd5fc3">Please read this article to help set up the metric beat.</a></li><li><a href="https://medium.com/@vikas.yadav3785/getting-started-with-filebeat-5efe181324ae?sk=a653790e2ca0e510941daf6c7aaf5088">Please read this article to help set up file beat</a></li></ol><p>We’ll use the APT repository method to install Filebeat.</p><h4>Installation and configuration of Auditbeat on ELK Server</h4><ol><li><strong>Install Audit beat</strong></li></ol><pre>apt-get install auditbeat</pre><p><strong>2. Configure Auditbeat modules</strong></p><pre><strong>###Auditd module</strong></pre><pre><strong>## Go to identity changes and add following file watches</strong></pre><pre>-w /etc/elasticsearch/elasticsearch.yml -p wa -k elk_changes</pre><pre>-w /etc/kibana/kibana.yml -p wa -k elk_changes</pre><pre><strong>### file_integrity module</strong></pre><pre>/etc/elasticsearch</pre><pre>/etc/kibana</pre><pre>/etc/metricbeat</pre><pre>/etc/metricbeat/modules.d</pre><pre>/etc/filebeat</pre><pre>/etc/filebeat/module.d</pre><pre>/etc/auditbeat</pre><pre>exclude_files:</pre><pre>- &#39;([^\s]+).reference.yml&#39;</pre><pre><strong>### System module</strong></pre><pre># No change needed</pre><p><strong>3. Configure Auditbeat general settings</strong></p><pre>tags: [&quot;elk&quot;]</pre><pre><strong>### Setup dashboards</strong></pre><pre>setup.dashboards.enabled: true</pre><pre><strong>### Kibana</strong></pre><pre>host: &quot;localhost:5601&quot;</pre><pre><strong>### elasticsearch output</strong></pre><pre>hosts: [&quot;localhost:9200&quot;]</pre><pre>protocol: &quot;http&quot;</pre><pre>username: &quot;elastic&quot;</pre><pre>password: &quot;goodwitch&quot;</pre><pre><strong>### logging</strong></pre><pre>logging.to_files: true</pre><pre>logging.files:</pre><pre>path: /var/log/auditbeat</pre><pre>name: auditbeat</pre><pre>keepfiles: 7</pre><pre>permissions: 0644</pre><pre><strong>### setup monitoring through metricbeat</strong></pre><pre>http.enabled: true</pre><pre>http.port: 5068</pre><p><strong>5. Enable beat-pack if not already enabled</strong></p><pre>sudo metricbeat modules enable beat-xpack</pre><p><strong>6. configure beat-expack</strong></p><pre>sudo nano /etc/metricbeat/modules.d/beat-xpack.yml</pre><pre>hosts: [&quot;http://localhost:5067&quot;,&quot;http://localhost:5068&quot;]</pre><pre>username: &quot;beats_system&quot;</pre><pre>password: &quot;avatar&quot;</pre><p><strong>7. Validate metricbeat service is running</strong></p><pre>systemctl status metricbeat</pre><p><strong>8. start audit beat</strong></p><pre>systemctl start auditbeat</pre><p><strong>10. Stack monitoring</strong></p><p>If your audit beat service has been successfully deployed and configured, you should be able to see audit beat come up under stack monitoring-&gt; Beats</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*h_RpVultZPfdTFzQd8DRYg.png" /></figure><p><strong>11. Dashboards</strong></p><p>Finally, you can go to dashboards and check one of the pre-built dashboards for auditbeat</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/0*voONJaN-nANn4QSi.png" /></figure><p>So, here’s how you can configure audit beat to monitor your users and processes.</p><p>If you want to do some hands-on practice on Elaticsearch, <a href="http://single-node%20elasticsearch%20cluster/">here is the link to my youtube playlist where I show you how to can set up a lab setup with 2 apache servers feeding data to a single-node Elasticsearch cluster deployed on a google cloud platform or GCP.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c080e2516fcd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-dudes/getting-started-with-auditbeat-c080e2516fcd">Getting started with Auditbeat</a> was originally published in <a href="https://medium.com/devops-dudes">DevOps Dudes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with Filebeat]]></title>
            <link>https://medium.com/devops-dudes/getting-started-with-filebeat-5efe181324ae?source=rss-baf09dd15079------2</link>
            <guid isPermaLink="false">https://medium.com/p/5efe181324ae</guid>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[elastic-stack]]></category>
            <category><![CDATA[secdevops]]></category>
            <category><![CDATA[filebeat]]></category>
            <category><![CDATA[log-analysis]]></category>
            <dc:creator><![CDATA[vikas yadav]]></dc:creator>
            <pubDate>Sat, 31 Jul 2021 14:04:50 GMT</pubDate>
            <atom:updated>2021-07-31T18:24:02.171Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to analyze log files using Filebeat and Elasticsearch</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eqLgREky-iNFPQbo" /><figcaption>Photo by <a href="https://unsplash.com/@ngeshlew?utm_source=medium&amp;utm_medium=referral">Lewis Kang&#39;ethe Ngugi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Inspecting and analyzing system log files are a part and parcel of every IT system administrator’s day. A centralized logging system makes life easier for IT admins and helps identify and fix faults more efficiently, ELK stack can help you store your logging data centrally and analyze your log files.</p><p>In the previous articles, I gave an <a href="https://medium.com/@vikas.yadav3785/elastic-stack-a-birds-eye-view-153a45e9888">overview of the elastic stack</a> and <a href="https://medium.com/@vikas.yadav3785/how-to-deploy-elasticsearch-5b1105e3063a">installed an elastic search on Linux</a>. In this article, I’ll focus on Filebeat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/0*m17U0DiQmcdTN94K.png" /></figure><blockquote>Filebeat is a light weight log shipper which is installed as an agent on your servers and monitors the log files or locations that you specify, collects log events, and forwards them either to Elasticsearch or log stash for indexing</blockquote><p>Filebeat has two components</p><ol><li><strong>Harvester</strong> — A <em>harvester</em> is responsible for reading the content of a single file. The harvester reads each file, line by line, and sends the content to the output.</li><li><strong>Input </strong>— An <em>input </em>is responsible for managing the harvesters and finding all sources to read from</li></ol><h3><strong>How Filebeat works</strong></h3><ol><li>It starts with one or more inputs that look in the locations you’ve specified for log data.</li><li>For each log that Filebeat locates, it starts a <strong>harvester</strong>.</li><li>Each <strong>harvester</strong> reads a single log for new content and sends the new log data to <strong>libbeat</strong>,</li><li><strong>Libbeat</strong> aggregates the events and sends the aggregated data to the output that you’ve configured for File beat.</li></ol><h3><strong>Lab Setup</strong></h3><p>In this article, I’ll set up a single-node elastic search cluster(<a href="https://medium.com/devops-dudes/how-to-deploy-elasticsearch-5b1105e3063a?sk=f51f2760e6af13954fad256adea42035">refer to this article</a>) and two apache webservers. I have used the GCP platform to build my test lab since it offers $300 USD free trial credit but you can do it on your servers or any other public cloud platform as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/0*VCifGBbOq6I5gigs.jpeg" /></figure><h3>Filebeat Installation</h3><p>Note: You’ll need an existing elastic search cluster to store log data and Kibana to visualize this data. We will also need metric beat installed on this server.</p><ol><li><a href="https://medium.com/@vikas.yadav3785/how-to-deploy-elasticsearch-5b1105e3063a">Please read this article to help set up a single-node elastic search instance and Kibana</a>.</li><li><a href="https://medium.com/devops-dudes/getting-started-with-metricbeat-7c5718e6b3f4?sk=03b112610d7f68f9bef13037d1fd5fc3">Please read this article to help set up the metric beat.</a></li></ol><p>We’ll use the APT repository method to install Filebeat.</p><h3><strong>Installation and configuration of Filebeat on ELK Server</strong></h3><p>Minimum software requirements for Filebeat installation on ELK server should already be met as we already have elastic search and Metricbeat installed on this server.</p><h4><strong>1. Validate logging configuration</strong></h4><p>To start with out file beat setup, we need to first validate that logging is correctly setup for various components of our lab</p><p><strong>1.1 Elasticsearch</strong></p><pre>path.logs: /var/log/elasticsearch</pre><p><strong>1.2 Kibana</strong></p><p><strong>1.2.1 configure Kibana logging</strong></p><pre>logging.dest: /var/log/kibana</pre><pre>logging.rotate.enabled: true</pre><pre>logging.rotate.keepFiles: 7</pre><p><strong>1.2.2 Create log file for Kibana</strong></p><pre>touch /var/log/kibana</pre><pre>chown kibana:kibana /var/log/kibana</pre><p><strong>1.2.3 configure logging for Metricbeat</strong></p><pre><em>sudo nano /etc/metricbeat/metricbeat.yml</em></pre><pre>## In the logging section, configure the following</pre><pre>logging.to_files: true</pre><pre>logging.files:</pre><pre>path: /var/log/metricbeat</pre><pre>name: metricbeat</pre><pre>keepfiles: 7</pre><pre>permissions: 0644</pre><p><strong>1.2. Restart service for changes to take effect</strong></p><pre>sudo systemctl restart elasticsearch</pre><pre>sudo systemctl restart kibana</pre><pre>sudo systemctl restart metricbeat</pre><p><strong>2. Install Filebeat</strong></p><pre>apt-get install filebeat</pre><p><strong>3. Configure Filebeat</strong></p><pre><em>sudo /etc/filebeat/filebeat.yml</em></pre><pre><strong>### Live Reloadding</strong></pre><pre>reload.enabled: true</pre><pre>reload.period: 10s</pre><pre><strong>### Setup dashboards</strong></pre><pre>setup.dashboards.enabled: true</pre><pre><strong>### Kibana</strong></pre><pre>host: “localhost:5601”</pre><pre><strong>### elasticsearch output</strong></pre><pre>hosts: [“localhost:9200”]</pre><pre>protocol: “http”</pre><pre>username: “elastic”</pre><pre>password: “goodwitch”</pre><pre><strong>### logging.to_files: true</strong></pre><pre>logging.files:</pre><pre>path: /var/log/filebeat</pre><pre>name: filebeat</pre><pre>keepfiles: 7</pre><pre>permissions: 0644</pre><pre><strong>### setup monitoring through metricbeat</strong></pre><pre>http.enabled: true</pre><pre>http.port: 5067</pre><p><strong>4. Enable beat-pack if not already enabled</strong></p><pre>sudo metricbeat modules enable beat-xpack</pre><p><strong>5. Configure beat-expack</strong></p><pre>sudo nano /etc/metricbeat/modules.d/beat-xpack.yml</pre><pre>hosts: [“http://localhost:5067&quot;]</pre><pre>username: “beats_system”</pre><pre>password: “avatar”</pre><p><strong>6. Validate Metricbeat service is running</strong></p><pre>systemctl status metricbeat</pre><p><strong>7. Start Filebeat</strong></p><pre>systemctl start filebeat</pre><p><strong>8. Enable modules</strong></p><pre>sudo filebeat modules enable elasticsearch</pre><pre>sudo filebeat modules enable kibana</pre><pre>sudo filebeat modules enable system</pre><p>With our ELK server setup with Filebeat, it is time to move on to our webservers.</p><h3>Installation and configuration of Filebeat on Web Servers</h3><p><strong>1. Download and install the public signing key</strong></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><strong>2. Install apt-transport-https package</strong></p><pre>sudo apt-get install apt-transport-https -y</pre><p><strong>3. Save directory definitions</strong></p><pre>echo “deb <a href="https://artifacts.elastic.co/packages/7.x/apt">https://artifacts.elastic.co/packages/7.x/apt</a> stable main” | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list</pre><p><strong>4. System Update</strong></p><pre>sudo apt-get update</pre><p><strong>5. Validate logging is configured for Metricbeat</strong></p><pre><em>sudo nano /etc/metricbeat/metricbeat.yml</em></pre><pre>logging.to_files: true</pre><pre>logging.files:</pre><pre>path: /var/log/metricbeat</pre><pre>name: metricbeat</pre><pre>keepfiles: 7</pre><pre>permissions: 0644</pre><p><strong>6. Restart service for changes to take effect</strong></p><pre>sudo systemctl restart metricbeat</pre><p><strong>7. Install Filebeat</strong></p><pre>apt-get install filebeat</pre><p><strong>8. Configure Filebeat</strong></p><pre><em>sudo /etc/filebeat/filebeat.yml</em></pre><pre><strong>### Live Reloadding</strong></pre><pre>reload.enabled: true</pre><pre>reload.period: 10s</pre><pre><strong>### Setup dashboards</strong></pre><pre>setup.dashboards.enabled: true</pre><pre><strong>### Kibana</strong></pre><pre>host: “localhost:5601”</pre><pre><strong>### elasticsearch output</strong></pre><pre>hosts: [“localhost:9200”]</pre><pre>protocol: “http”</pre><pre>username: “elastic”</pre><pre>password: “goodwitch”</pre><pre><strong>### logging.to_files: true</strong></pre><pre>logging.files:</pre><pre>path: /var/log/filebeat</pre><pre>name: filebeat</pre><pre>keepfiles: 7</pre><pre>permissions: 0644</pre><pre><strong>### setup monitoring through metricbeat</strong></pre><pre>http.enabled: true</pre><pre>http.port: 5067</pre><p><strong>9. Enable beat-pack if not already enabled</strong></p><pre>sudo metricbeat modules enable beat-xpack</pre><p><strong>10. configure beat-expack</strong></p><pre>sudo nano /etc/metricbeat/modules.d/beat-xpack.yml</pre><pre>hosts: [“http://localhost:5067&quot;]</pre><pre>username: “beats_system”</pre><pre>password: “avatar”</pre><p><strong>11. Validate Metricbeat service is running</strong></p><pre>systemctl status metricbeat</pre><p><strong>## 12. start Filebeat</strong></p><pre>systemctl start filebeat</pre><p><strong>13. Enable modules</strong></p><pre>sudo filebeat modules enable apache</pre><pre>sudo filebeat modules enable system</pre><p><strong>14. Stack monitoring</strong></p><p>You can view if your beats are set up correctly under the stack monitoring, you should now be able to see Filebeat listed under your beats</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fePeg898HcAhsl0kTUdaKA.png" /></figure><p>If you click on a beat and select one of the servers, you should be able to see some more statistics</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DYOs1-R1Qg_I1NjN2ozLIQ.png" /></figure><p><strong>15. Dashboards</strong></p><p>If your system is set up correctly , you should be able to see a dashboard just like this one</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WTIpUMbOE4xFsqna.png" /><figcaption>ou</figcaption></figure><p>So, here’s how you can configure Filebeat to store your logging data centrally.</p><p>If you want to do some hands-on practice on Elaticsearch, <a href="http://single-node%20elasticsearch%20cluster/">here is the link to my youtube playlist where I show you how to can set up a lab setup with 2 apache servers feeding data to a single-node Elasticsearch cluster deployed on a google cloud platform or GCP.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5efe181324ae" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-dudes/getting-started-with-filebeat-5efe181324ae">Getting started with Filebeat</a> was originally published in <a href="https://medium.com/devops-dudes">DevOps Dudes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with Metricbeat]]></title>
            <link>https://medium.com/devops-dudes/getting-started-with-metricbeat-7c5718e6b3f4?source=rss-baf09dd15079------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c5718e6b3f4</guid>
            <category><![CDATA[elastic-stack]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[log-analytics]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[metricbeat]]></category>
            <dc:creator><![CDATA[vikas yadav]]></dc:creator>
            <pubDate>Sat, 19 Sep 2020 04:32:46 GMT</pubDate>
            <atom:updated>2021-07-31T11:16:20.028Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to monitor system metrics data using Metricbeat and elasticsearch.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e40ySqN7q2ZsokY3" /><figcaption>Photo by <a href="https://unsplash.com/@campaign_creators?utm_source=medium&amp;utm_medium=referral">Campaign Creators</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>IT systems can be monitored for various attributes such as performance, reliability, availability etc. <strong>Metrics is the measurement of behaviour and usage of system resources that can be collected and monitored from the system</strong>.</p><p>In today’s day and age of highly complex IT systems and environments, <strong>monitoring of system metrics helps increase the availability and reliability of the system</strong> and allows IT teams to quickly respond to any fault if they occur.</p><p>ELK stack became elastic stack with the addition of beats, a family of light-weight shippers used for different use cases and data sets. In the previous articles, I gave an <a href="https://medium.com/@vikas.yadav3785/elastic-stack-a-birds-eye-view-153a45e9888">overview of the elastic stack</a> and <a href="https://medium.com/@vikas.yadav3785/how-to-deploy-elasticsearch-5b1105e3063a">installed an elastic search on Linux</a>. In this article, I’ll focus on Metricbeat.</p><blockquote><strong>Metricbeat</strong> is a lightweight agent that can be installed on target servers to periodically collect metric data from your target servers, this could be operating system metrics such as CPU or memory or data related to services running on the server. It can also be used to monitor other beats and ELK stack itself. It is built on top of libbeat — a GO framework.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/0*6axE2zHZt_fsLFFx.png" /></figure><p>It can be configured to send output to <strong>elasticsearch directly</strong> or to <strong>logstash if you need to transform the data.</strong></p><p><strong>Lab Setup</strong></p><p>In this article, I’ll set up a single-node elastic search cluster(<a href="https://medium.com/devops-dudes/how-to-deploy-elasticsearch-5b1105e3063a?sk=f51f2760e6af13954fad256adea42035">refer to this article</a>) and two apache webservers. I have used the GCP platform to build my test lab since it offers $300 USD free trial credit but you can do it on your servers or any other public cloud platform as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*qQigkm-vJ7tBSq8ZwpPIng.jpeg" /></figure><p>We’ll use metricbeat’s <a href="https://www.elastic.co/guide/en/beats/metricbeat/current/monitoring-internal-collection.html">internal collection method </a>to collect monitoring data about our elasticsearch cluster.</p><p>We’ll also setup metricbeat to collect metric data from our webservers and send it to elasticsearch.</p><h4>Metricbeat Installation</h4><p>Note: You’ll need an existing elasticsearch cluster to store metrics data and Kibana to visualise this data. <a href="https://medium.com/@vikas.yadav3785/how-to-deploy-elasticsearch-5b1105e3063a">Please read this article to help set up a single-node elasticsearch instance and Kibana</a>.</p><p>We’ll use the APT repository method to install Metricbeat.</p><p><strong>Installation and configuration of Metricbeat on ELK Server</strong></p><ol><li><strong>Enable Monitoring on Elasticsearch Cluster</strong></li></ol><p>Before we can install metricbeat to monitor our ELK cluster, we first need to enable monitoring in our elasticsearch.yml file</p><pre>cd /etc/elasticsearch</pre><pre>sudo nano /etc/elasticsearch/elasticsearch.yml</pre><pre>xpack.monitoring.collection.enabled: true</pre><pre>xpack.monitoring.elasticsearch.collection.enabled: true</pre><p><strong>2. Restart Elasclearticsearch service</strong></p><pre>sudo systemctl restart elasticsearch</pre><p><strong>3. Install Metricbeat</strong></p><p>Note: Steps 3.1–3.3 are not necessary if you have previously set up your APT repository during elasticsearch deployment</p><p><strong>3.1. Download and install public signing key</strong></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><strong>3.2. Install apt-transport-https package</strong></p><pre>sudo apt-get install apt-transport-https -y</pre><p><strong>3.3. Save directory definitions</strong></p><pre>echo “deb <a href="https://artifacts.elastic.co/packages/7.x/apt">https://artifacts.elastic.co/packages/7.x/apt</a> stable main” | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list</pre><p><strong>3.4. Install Metricbeat</strong></p><pre>sudo apt-get update &amp;&amp; sudo apt-get install metricbeat</pre><p><strong>4. Configure Metribeat</strong></p><p>Metricbeat configuration can be found in <em>/etc/metricbeat/metricbeat.yml</em> file. Please be careful while configuring this file since YAML is syntax sensitive. <a href="https://medium.com/@vikas.yadav3785/write-your-first-yaml-291036749535">Please feel free to read this article to learn a bit more about YAML.</a></p><pre>sudo su</pre><pre>nano /etc/metricbeatmetricbeat.yml</pre><pre>### live monitoring section</pre><pre>reload.enabled: true</pre><pre>reload.period: 10s</pre><pre>### name and tag</pre><pre>name: elk-metrics</pre><pre>Tags: demo-elk</pre><pre>env: lab</pre><pre>### enable kibana dashboards</pre><pre>Setup.dashboards.enabled: true</pre><pre>host: &lt;&lt;ip_address_of_elastic_server&gt;&gt;:5601</pre><pre>### output configuration</pre><pre>output.elasticsearch:</pre><pre># Array of hosts to connect to.</pre><pre>hosts: [“&lt;&lt;ip_address_of_elastic_server&gt;&gt;:9200”]</pre><pre># Protocol — either `http` (default) or `https`.</pre><pre>protocol: “https”</pre><pre>username: “elastic” #### elasticsuperuser</pre><pre>password: “password”. #### elastic users password</pre><pre>## logging</pre><pre>logging.level: debug</pre><pre>logging.selectors: [“*”]</pre><pre>logging.to_files: true</pre><pre>logging.files:</pre><pre>path: /var/log/metricbeat</pre><pre>name: metricbeat</pre><pre>keepfiles: 7</pre><pre>permissions: 0644</pre><pre>## enable interal collection of metricbeat</pre><pre>monitoring.enabled: true</pre><pre>monitoring.elasticsearch</pre><p>one configuration I’d like to point out in the metricbeat.yml configuration file is live reload</p><pre>reload.enabled: true<br>reload.period: 10s</pre><p>this config allows the user to make changes to module configurations files without the need to restart metricbeat service. Metricbeat checks if there have been any changes made to the module configuration filed based on the timer set in <em>reload.period</em> setting.</p><p><strong>5. Start Metricbeat</strong></p><pre>sudo systemctl start metricbeat</pre><p><strong>6. Modules and metric sets</strong></p><p>Metricbeat does its magic by using <strong>modules</strong> and <strong>metric sets</strong>. Let&#39;s try and understand these:</p><p>Let&#39;s say you want to m<strong>onitor one of your Linux servers for its CPU, load, memory etc</strong>. what you’ll need to do is after you install metric beat on the VM you need to <strong>enable a module called system</strong> which provides system monitoring information. The system module allows you to monitor a lot of things as listed below</p><pre>metricsets:<br> — cpu # CPU usage<br> — load # CPU load averages<br> — memory # Memory usage<br> — network # Network IO<br> — process # Per process metrics<br> — process_summary # Process summary<br> — uptime # System Uptime<br> — socket_summary # Socket summary<br> #- core # Per CPU core usage<br> #- diskio # Disk IO<br> #- filesystem # File system usage for each mountpoint<br> #- fsstat # File system summary metrics<br> #- raid # Raid<br> #- socket # Sockets and connection info (linux only)<br> #- service # systemd service information</pre><p>Each of these items individually is called a <strong>metric set</strong>. You can either choose to enable all of these or only the ones that you are interested in.</p><p><strong>6.1 Configure Modules for ELK servers</strong></p><p>For our elasticsearch cluster, we’ll configure</p><ul><li>elasticsearch-xpack</li><li>Kibana-xpack</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*aiiH7RnNwl3Xrs8suYpb7w.png" /></figure><p><strong>6.1 Enable elasticsearch-xpack</strong></p><p>First, we’ll need to enable the module using the following</p><pre>sudo metricbeat modules enable elasticsearch-xpack</pre><p>After the module has been enabled, it can be configured using <em>/etc/metricbeat/modules.d/elasticsearch-xpack.yml</em> file</p><pre>nano <em>/etc/metricbeat/modules.d/</em>elasticsearch-xpack.yml</pre><pre>- module: elasticsearch<br>    xpack.enabled: true<br>    period: 10s<br>    hosts: [&quot;http://localhost:9200&quot;] <br>    #scope: node <br>    username: &quot;remote_monitoring_user&quot;<br>    password: &quot;remote_monitoring_user_password&quot;<br>    #ssl.enabled: true<br>    #ssl.certificate_authorities: [&quot;/etc/pki/root/ca.pem&quot;]<br>    #ssl.certificate: &quot;/etc/pki/client/cert.pem&quot;<br>    #ssl.key: &quot;/etc/pki/client/cert.key&quot;<br>    #ssl.verification_mode: &quot;full&quot;<br>    xpack.enabled: true</pre><p><strong>6.2 Enable Kibana-xpack</strong></p><p>As we’ve done earlier, first we’ll need to enable Kibana-xpack module</p><pre>sudo metricbeat modules enable kibana-xpack</pre><p>After the module has been enabled, it can be configured using <em>/etc/metricbeat/modules.d/kibana-xpack.yml</em> file</p><pre>nano <em>/etc/metricbeat/modules.d/</em>kibana-xpack.yml</pre><pre>- module: kibana<br>  metricsets:<br>    - stats<br>  period: 10s<br>  hosts: [&quot;localhost:5601&quot;]<br>  #basepath: &quot;&quot;<br>  #username: &quot;remote_monitoring_user&quot;<br>  #password: &quot;remote_monitoring_user_password&quot;<br>  xpack.enabled: true</pre><h4><strong>Installation and configuration of Metricbeat on WebServer</strong></h4><p>Note: Repeat steps 1–5 from above to install and configure metricbeat on each web server in the setup.</p><p>On our webserver we’ll enable the following modules</p><ol><li>Apache</li><li>System(enabled by default)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*dZCD53sv8_v2UYAsOONmdw.png" /></figure><p><strong>1. Enable apache</strong></p><pre>sudo metricbeat modules enable apache</pre><p>After the module has been enabled, we can configure the module using <em>/etc/metricbeat/modules.d/apache.yml</em> file.</p><pre><br>sudo nano <em>/etc/metricbeat/modules.d/apache.yml</em></pre><pre><br>metricbeat.modules:<br>- module: apache<br>  metricsets: [&quot;status&quot;]<br>  period: 10s<br>  enabled: true<br><br>  # Apache hosts<br>  hosts: [&quot;http://127.0.0.1&quot;]<br><br>  # Path to server status. Default server-status<br>  #server_status_path: &quot;server-status&quot;<br><br>  # Username of hosts.  Empty by default<br>  #username: username<br><br>  # Password of hosts. Empty by default<br>  #password: password</pre><p><strong>### All configuration should be live reloaded using our live reload configuration</strong></p><p>Once everything is configured, log in to your Kibana IP address and go to dashboards and search for metricbeat to look at some awesome dashboards created by default</p><pre>http(s)://kibana_ip:5601</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v5L9m7Fiq2Yv2RFe.png" /></figure><p>So, here’s how you can configure metricbeat to send you system metrics data to elasticsearch.</p><p>If you want to do some hands-on practice on Elaticsearch, <a href="http://single-node%20elasticsearch%20cluster/">here is the link to my youtube playlist where I show you how to can set up a lab setup with 2 apache servers feeding data to a single-node Elasticsearch cluster deployed on a google cloud platform or GCP.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c5718e6b3f4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-dudes/getting-started-with-metricbeat-7c5718e6b3f4">Getting started with Metricbeat</a> was originally published in <a href="https://medium.com/devops-dudes">DevOps Dudes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to deploy elasticsearch]]></title>
            <link>https://medium.com/devops-dudes/how-to-deploy-elasticsearch-5b1105e3063a?source=rss-baf09dd15079------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b1105e3063a</guid>
            <category><![CDATA[log-analytics]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[elastic-stack]]></category>
            <category><![CDATA[elk-stack]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[vikas yadav]]></dc:creator>
            <pubDate>Tue, 01 Sep 2020 11:43:04 GMT</pubDate>
            <atom:updated>2020-10-15T13:21:04.694Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to deploy Elasticsearch</h3><h4>Deploying a single-node elasticsearch cluster on Linux in 10 steps</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*9fsgtJYF8VaU5UDxBmohHQ.png" /></figure><p>The best way to learn anything is by doing it!</p><p>With that in mind, I welcome you to part 2 of this series where we’ll deploy a single-node elasticsearch cluster in 10 steps on Ubuntu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*sC_XalQpppzTwNMXqOTXzA.png" /><figcaption>elasticsearch</figcaption></figure><p><a href="https://medium.com/@vikas.yadav3785/elastic-stack-a-birds-eye-view-153a45e9888">If you haven&#39;t read part 1 I suggest you start there, I discuss various components of the Elastic stack</a></p><p>There are multiple ways to install elasticsearch, we’ll use the <em>deb package</em> which is suitable for Debian-based Linux systems.</p><p><strong>Pre-requisites</strong></p><p>A <strong>pre-requisite</strong> for this article is that you have an <strong>Ubuntu virtual machine</strong>(or any other Debian-based system), you can set this up on your hardware or you can use one of the public cloud options. You can also follow my youtube videos that will help you set up your elasticsearch lab on a google cloud platform or GCP, you’ll need to do 3 things</p><ol><li><a href="https://www.youtube.com/watch?v=W7V3OTbFbkI&amp;feature=youtu.be">Set up your GCP account</a></li><li><a href="https://www.youtube.com/watch?v=rdBe1QSYeig&amp;feature=youtu.be">Create a new VPC and configure networking for your elasticsearch lab</a></li><li><a href="https://www.youtube.com/watch?v=naQJiUv_AQE&amp;feature=youtu.be">Create virtual machines to host your elasticsearch cluster in GCP</a></li></ol><p>With pre-requisites out of the way, let&#39;s deploy our elasticsearch demo system</p><p><strong>1. Download and install elasticsearch’s public signing key</strong></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><strong>2. Install apt-transport-https package</strong></p><pre>sudo apt-get install apt-transport-https -y</pre><p><strong>3. Save directory definitions </strong>to<strong> </strong><em>/etc/apt/sources.list.d/elastic-7.x.list</em></p><pre>echo “deb <a href="https://artifacts.elastic.co/packages/7.x/apt">https://artifacts.elastic.co/packages/7.x/apt</a> stable main” | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list</pre><p><strong>5. Update the system and Install elasticsearch and Kibana</strong></p><pre>sudo apt-get update</pre><pre>sudo apt-get install elasticsearch &amp;&amp; sudo apt-get install kibana</pre><p><strong>6. configure elasticsearch</strong></p><p>Once elasticsearch and Kibana are installed, it is time to configure each application, lets start with elasticsearch. Elasticsearch configuration file can be found at <em>/etc/elasticsearch/elasticsearch.yml</em></p><pre># Open elasticsearch configuration file with a text editor like nano</pre><pre>   sudo nano /etc/elasticsearch/elasticsearch.yml</pre><pre># Configure the following settings in your elasticsearch.yml file</pre><pre>   cluster.name: demo-elk      # give the cluster a descriptive name</pre><pre>   node.name: elk-1            # give the node a descriptive name</pre><pre>   network.host: 0.0.0.0       # change network binding</pre><pre>   discovery.type: single-node # configure as single-node cluster</pre><pre># save the file</pre><p><strong>7. Start Elasticsearch service</strong></p><p>once you have saved elasticsearch.yml, you can start elasticsearch service using the following command</p><pre>sudo systemctl start elasticsearch</pre><p><strong>8. Validate Elasticsearch cluster health</strong></p><p>After the service starts, check the health of your cluster using the following command</p><pre>curl -XGET <a href="http://localhost:9200/_cluster/health?pretty">http://localhost:9200/_cluster/health?pretty</a></pre><p>It should display something like this</p><pre>{<br>“cluster_name” : “demo-elk”,<br> “status” : “yellow”,<br> “timed_out” : false,<br> “number_of_nodes” : 1,<br> “number_of_data_nodes” : 1,<br> “active_primary_shards” : 34,<br> “active_shards” : 34,<br> “relocating_shards” : 0,<br> “initializing_shards” : 0,<br> “unassigned_shards” : 12,<br> “delayed_unassigned_shards” : 0,<br> “number_of_pending_tasks” : 0,<br> “number_of_in_flight_fetch” : 0,<br> “task_max_waiting_in_queue_millis” : 0,<br> “active_shards_percent_as_number” : 73.91304347826086<br>}</pre><p><strong>9. configure Kibana</strong></p><p>Next, its time to configure Kibana. Kibana configuration file can be found at <em>/etc/kibana/kibana.yml.</em></p><pre># Open Kibana configuration file with a text editor like nano</pre><pre>   sudo nano /etc/kibana/kibana.yml</pre><pre># Configure the following settings in your elasticsearch.yml file</pre><pre>server.port: 5601                         # uncomment server.port</pre><pre>server.host: “0.0.0.0”                    # change server.host</pre><pre>server.name: “demo-kibana”                # change server.name</pre><pre># uncomment elasticsearch.hosts<br>elasticsearch.hosts: [“http://localhost:9200&quot;] </pre><p><strong>9. start Kibana service</strong></p><pre>systemctl start kibana</pre><p><strong>10. enable elasticsearch and Kibana</strong></p><pre>systemctl enable elasticsearch</pre><pre>systemctl enable kibana</pre><p>Open Kibana by typing in IP address of your elk and port 5601</p><pre>http:\\&lt;&lt;ip_address&gt;&gt;:5601</pre><p>and it should display the home page for Kibana.</p><p>Please feel free to have a look at my youtube video on how to install elasticsearch.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F5L6LOhG20V0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D5L6LOhG20V0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F5L6LOhG20V0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f5ba53c30a4a4b5e653d3a3225d67cd0/href">https://medium.com/media/f5ba53c30a4a4b5e653d3a3225d67cd0/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b1105e3063a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-dudes/how-to-deploy-elasticsearch-5b1105e3063a">How to deploy elasticsearch</a> was originally published in <a href="https://medium.com/devops-dudes">DevOps Dudes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A little push is all that's needed!]]></title>
            <link>https://medium.com/@vikas.yadav3785/a-little-push-is-all-thats-needed-1d9739d025f?source=rss-baf09dd15079------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d9739d025f</guid>
            <category><![CDATA[inspirational-quotes]]></category>
            <category><![CDATA[inspiration]]></category>
            <dc:creator><![CDATA[vikas yadav]]></dc:creator>
            <pubDate>Sun, 30 Aug 2020 12:01:04 GMT</pubDate>
            <atom:updated>2020-08-30T12:01:04.931Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*s0R15a7IWoXIaw8pEyeD4w.png" /></figure><p>“Do you know where the majority of big ideas end up?” — Friend asked</p><p>“Where?” — I replied</p><p>“In the graveyard!”</p><p>Was the answer given and there was some truth in it, I thought! Anyway, that was part of a conversation I had with one of my mates on a Friday night puffing sheesha smoke in the air. It made me think, reminded me of all the ideas I ever had or my friends shared with me that for that very moment when they were conceived seemed so good but died the slow death that comes due to overthinking about how others will perceive them, “it was a silly idea, people will laugh at me” or something similar is what drives the last nail in the coffin.</p><p>I wanted to write stories some years ago, I even secretly started writing a novel. I don’t remember what it was about now but I do remember hiding the pages after I wrote them under my bed and I was worried that no one should find them. I was worried I will be embarrassed if someone finds out, people will make fun of me. <strong><em>Friends</em></strong> will make fun of me!!</p><p>This social anxiety is what limits us, <strong><em>stops us</em></strong> from reaching our potential. Today, we have the tools available to express ourselves; tools like youtube or medium where you can showcase skills be it a motivational blog or an IT tutorial. We are too socially conscious to use them however, a small business owner friend wants to make a marketing video about his business, another one has a melodious voice and wants to record a song in her voice but they’ve been talking about it for a while. Why do we procrastinate, hold ourselves back? I mean would you want to be on your death bed and think “I should’ve tried that?”.</p><p>When an object is at rest, a small amount of force will result in no motion. The force of friction is greater than the applied force. This is called static friction. A little more force and the object “<strong><em>breaks free</em></strong>” and moves, although you still need to apply force to keep the object moving called kinetic friction, You do not need to apply quite as much force to keep it moving as you needed to originally break free of static friction.</p><p>These are scientific terms but I think they fit quite well in life. All we need is a <strong>little push</strong> to overcome the static friction stopping us from implementing our ideas, a little more force, and your idea will “<strong>break free</strong>”. You will need to work for it to be successful but it won&#39;t be as hard. There are no guarantees that it will be successful but the next time you have an idea, it will need less force to overcome the initial inertia, the third time even lesser and even if none of your ideas are successful at the very least you won&#39;t lie on your death bed thinking “I should’ve tried that!”.</p><p>Remember, to bring out a baby even mums needs to “<strong>PUSH”</strong> and creators are like mums and ideas like babies.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d9739d025f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elastic Stack — A bird’s eye view]]></title>
            <link>https://medium.com/devops-dudes/elastic-stack-a-birds-eye-view-153a45e9888?source=rss-baf09dd15079------2</link>
            <guid isPermaLink="false">https://medium.com/p/153a45e9888</guid>
            <category><![CDATA[elastic]]></category>
            <category><![CDATA[elastic-stack]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[secdevops]]></category>
            <category><![CDATA[log-analytics]]></category>
            <dc:creator><![CDATA[vikas yadav]]></dc:creator>
            <pubDate>Sun, 30 Aug 2020 10:49:34 GMT</pubDate>
            <atom:updated>2020-10-15T13:19:30.776Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h3>Elastic Stack — A bird’s eye view</h3><h4>An overview of the elastic stack for beginners</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GPtjqHp7BTR9FSXV" /><figcaption>Photo by <a href="https://unsplash.com/@neostalgic?utm_source=medium&amp;utm_medium=referral">neostalgic</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Elastic stack has been growing in popularity in recent days as a platform of choice for various <strong>data analytics use cases</strong> including <strong>SIEM</strong>(Security information and event management).</p><p>It has multiple components that work together to provide <strong><em>search, analytics and visualization</em> </strong>capabilities for your data.</p><p>In this article, I will give you a <strong>birds-eye overview of the elastic stack in under 5 minutes!</strong></p><p><strong>Core Components</strong></p><p>Elastic stack was previously called <strong>ELK stack</strong> (some people might still use this acronym) where <strong>E</strong> stands for <strong>Elastic search</strong>, <strong>L</strong> stands for <strong>Logstash</strong> and <strong>K</strong> stands for <strong>Kibana, </strong>each of these core components have a specific task to perform in the elk or elastic stack so let’s have a look at what each one does</p><ul><li><strong>Elasticsearch</strong> — Elasticsearch is a <em>search and analytics engine </em>that is built on <a href="https://lucene.apache.org/">Apache Lucene</a> and is written in Java. It is distributed in nature and interactions with elastic search cluster are done using RestFul APIs.</li><li><strong>Log Stash</strong> — Log stash is server-side data processing pipeline which can be be used to transform the data before it is ingested by Elasticsearch.</li><li><strong>Kibana</strong> — Kibana is the user interface of choice for elastic search. You can administer your elastic search cluster and create awesome visualisations/dashboards using Kibana.</li></ul><figure><img alt="elasticsearch logo" src="https://cdn-images-1.medium.com/max/319/1*KoFL9-dmlHKY_-7U9uVS2Q.png" /><figcaption>elasticsearch</figcaption></figure><p>For a production cluster, you’ll need a little more features than those provided by these core components so let&#39;s have a look</p><p><strong>X-Pack</strong></p><p>X-Pack is an Elastic Stack extension that provides capabilities such as <strong>security, alerting, monitoring</strong> etc. One basic use case for X-pack is to <em>secure your elasticsearch cluster using basic username/password authentication</em>.</p><p>By default, X-Pack is installed when you install elastic search in the newer versions of elasticsearch so you don’t need to worry about installing X-pack anymore, however, <a href="https://www.youtube.com/watch?v=E-kwK88Vxzk&amp;feature=youtu.be"><em>you still have to enable and configure x-pack for your elastic cluster.</em></a></p><p><strong>Elastic Beats</strong></p><p>ELK stack became elastic stack with the addition of beats.</p><p><strong>Beats </strong>are <em>lightweight agents</em> or <em>shippers</em> that are <em>installed on the target machine</em> from where they can forward or ship data to either elastic search or log stash(if you need to parse and enhance your data).</p><p>Now, a picture says a thousand words so let’s have a look at a sample diagram</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*zWMWP8bzg505buk6e9qsaA.jpeg" /></figure><p>Here, we have metricbeat that is <strong>installed on a target apache server</strong>, this beats instances once installed can be <strong>configured to collect raw metric data</strong> from the server and can be either <strong>shipped to logstash</strong> if you want to <em>parse and enhance</em> this data <strong>or shipped directly to elasticsearch</strong>. Once data is stored inside elasticsearch, you can <strong>use Kibana to create cool visualizations</strong> and dashboards such the one below on top of this data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*bEojAJIgoR0zapUw1PJB5A.png" /><figcaption>Sample Kibana dashboard for metricbeat</figcaption></figure><p>There are multiple beats available at the time of writing this article so let’s have a look at each</p><ul><li><strong>Filebeat</strong> is used to forward log data such as system logs to your elasticsearch cluster. You can specify a file or a path to monitor for example <em>/var/log</em> directory on a Linux system and file beat will collect logs from this location and then ship them to either elastic search or log stash.</li><li><strong>Auditbeat</strong> is used to audit user and process activities for your target systems, for example, you can use audit beat to watch changes made to a file or collect events from Linux auditd framework and then feed them to either elastic search or log stash.</li><li><strong>Metricbeat</strong> is a lightweight agent that can be installed on target servers to periodically collect metric data from your target servers, this could be operating system metrics such as CPU or memory or data related to services running on the server. It can also be used to monitor other beats and ELK stack itself.</li><li><strong>Heartbeat</strong> is used to do a period health check of the status of services and can be used for uptime monitoring, for example, it can be used to check if your website is up and running.</li><li><strong>Packetbeat</strong> is used to get visibility of network traffic between your servers and is essentially a real-time network packet analyser. It can be used to analyse the performance of your applications.</li><li><strong>Journalbeat</strong> is used to monitor journald logs, it allows for complex filtering of logs that reduces the amount of log data that is published.</li><li><strong>Winlogbeat</strong> is a beats agents installed on windows servers and ships windows event logs. It can be installed as a windows service and can publish logs to either elastic search or log stash.</li><li><strong>Functionbeat</strong> is used for functions as a service environment, it collects data from your serverless cloud environments and ships it to elastic stack allowing the elastic stack to monitor serverless environments.</li></ul><p>So, there you have it a <strong>bird’s eye view of elastic stack in under 5 mins</strong>.</p><p><a href="https://medium.com/@vikas.yadav3785/how-to-deploy-elasticsearch-5b1105e3063a">Please feel free to check out part 2 of this series where we’ll install single-node elasticsearch cluster on Linux.</a></p><p>If you want to do some hands-on practice on Elaticsearch, <a href="http://single-node%20elasticsearch%20cluster/">here is the link to my youtube playlist where I show you how to can set up a lab setup with 2 apache servers feeding data to a single-node Elasticsearch cluster deployed on google cloud platform or GCP.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=153a45e9888" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-dudes/elastic-stack-a-birds-eye-view-153a45e9888">Elastic Stack — A bird’s eye view</a> was originally published in <a href="https://medium.com/devops-dudes">DevOps Dudes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>