<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Moshe Zada</title>
    <description>The latest articles on DEV Community by Moshe Zada (@moshe).</description>
    <link>https://dev.to/moshe</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F226466%2F50bfb073-5ddc-4b24-98ab-fef5ed8aeed1.jpeg</url>
      <title>DEV Community: Moshe Zada</title>
      <link>https://dev.to/moshe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/moshe"/>
    <language>en</language>
    <item>
      <title>A (secret) way to bypass Chrome's security/privacy error</title>
      <dc:creator>Moshe Zada</dc:creator>
      <pubDate>Fri, 25 Sep 2020 18:34:54 +0000</pubDate>
      <link>https://dev.to/moshe/a-secret-way-to-bypass-chrome-s-security-privacy-error-4h6i</link>
      <guid>https://dev.to/moshe/a-secret-way-to-bypass-chrome-s-security-privacy-error-4h6i</guid>
      <description>&lt;p&gt;You may notice that recently chrome adopted a strict approach for SSL certificates errors, and it's probably the right thing. Most internet users are should not get into websites with unverified certificates, but does it's the same for developers?&lt;br&gt;
As developers, we sometimes start local servers with self-signed certificated which can be blocked by Google Chrome.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcwesycws4f0lwos9el9j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcwesycws4f0lwos9el9j.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  So how can I bypass the warning page and continue coding?
&lt;/h3&gt;

&lt;p&gt;Simply type &lt;code&gt;thisisunsafe&lt;/code&gt; while the browser is focused on that page. That's it 🙂&lt;/p&gt;

</description>
      <category>security</category>
      <category>chrome</category>
      <category>privacy</category>
      <category>ssl</category>
    </item>
    <item>
      <title>Elasticsearch Comrade Part #1 - SQL Queries</title>
      <dc:creator>Moshe Zada</dc:creator>
      <pubDate>Mon, 30 Dec 2019 09:47:59 +0000</pubDate>
      <link>https://dev.to/moshe/elasticsearch-comrade-part-1-sql-queries-1i8c</link>
      <guid>https://dev.to/moshe/elasticsearch-comrade-part-1-sql-queries-1i8c</guid>
      <description>&lt;p&gt;This is the first part of an Elasticsearch Comrade introduction series.&lt;br&gt;
Elasticsearch Comrade is a management UI for common operations within elastic products.&lt;br&gt;
In this post, I will cover the SQL Editor feature.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/moshe"&gt;
        moshe
      &lt;/a&gt; / &lt;a href="https://github.com/moshe/elasticsearch-comrade"&gt;
        elasticsearch-comrade
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Elasticsearch admin panel built for ops and monitoring
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Elasticsearch Comrade &lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/59a2b658fd2916ebc6746e8a297037074c40f142/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6d6f7368655f7a6164613f7374796c653d736f6369616c"&gt;&lt;img src="https://camo.githubusercontent.com/59a2b658fd2916ebc6746e8a297037074c40f142/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6d6f7368655f7a6164613f7374796c653d736f6369616c" alt="Twitter Follow"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/eee1eea65c3fc767663f5dd8d85add820b4daad1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d76332e372b2d626c75652e737667"&gt;&lt;img src="https://camo.githubusercontent.com/eee1eea65c3fc767663f5dd8d85add820b4daad1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d76332e372b2d626c75652e737667" alt="python"&gt;&lt;/a&gt; &lt;a href="https://hub.docker.com/r/mosheza/elasticsearch-comrade" title="DockerHub" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/e6d5bb0f2069194456978c8a8bb53dff5982a211/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f6d6f7368657a612f656c61737469637365617263682d636f6d726164652e737667" alt="docker pulls"&gt;&lt;/a&gt; &lt;a href="https://circleci.com/gh/moshe/elasticsearch-comrade" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/8ca317b6191646b46bcc5e94513c8dc579dfd617/68747470733a2f2f636972636c6563692e636f6d2f67682f6d6f7368652f656c61737469637365617263682d636f6d726164652e7376673f7374796c653d737667" alt="CircleCI"&gt;&lt;/a&gt; &lt;a href="https://github.com/moshe/elasticsearch-comrade/issues"&gt;&lt;img src="https://camo.githubusercontent.com/c5283d35cf5bb6b8d4812fde99bd8b5b344c706f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6d6f7368652f656c61737469637365617263682d636f6d72616465" alt="GitHub issues"&gt;&lt;/a&gt; &lt;a href="https://github.com/moshe/elasticsearch-comrade/blob/master/LICENSE"&gt;&lt;img src="https://camo.githubusercontent.com/b7a58b5b7eb16c841afb0a61783f3a7c09e04df5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6f7368652f656c61737469637365617263682d636f6d72616465" alt="GitHub license"&gt;&lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;Elasticsearch Comrade is an open-source Elasticsearch admin and monitoring panel highly inspired by Cerebro.
Elasticsearch Comrade built with python3, VueJS, Sanic, Vuetify2 and Cypress
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(16).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dpus9Yhq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%2816%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/c8657e2536355c07279caa4672f145f7cd9164d9/68747470733a2f2f6d6f7368652e73682f2e6e65746c6966792f66756e6374696f6e732f696d673f736f757263653d676974687562"&gt;&lt;img src="https://camo.githubusercontent.com/c8657e2536355c07279caa4672f145f7cd9164d9/68747470733a2f2f6d6f7368652e73682f2e6e65746c6966792f66756e6374696f6e732f696d673f736f757263653d676974687562" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
Main Features&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Elasticsearch version 5,6 and 7 support (tested against elasticsearch 7.7)&lt;/li&gt;
&lt;li&gt;Multi cluster&lt;/li&gt;
&lt;li&gt;Rest API with autocompletion, history, templates, and history&lt;/li&gt;
&lt;li&gt;SQL editor (version 7 only)&lt;/li&gt;
&lt;li&gt;Built for big clusters&lt;/li&gt;
&lt;li&gt;Node statistics and monitoring&lt;/li&gt;
&lt;li&gt;Manage aliases&lt;/li&gt;
&lt;li&gt;Inspect running tasks&lt;/li&gt;
&lt;li&gt;Manage index templates&lt;/li&gt;
&lt;li&gt;Manage snapshots&lt;/li&gt;
&lt;li&gt;And much more ...&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
Quickstart&lt;/h1&gt;
&lt;h3&gt;
Cluster dir definitaions&lt;/h3&gt;
&lt;p&gt;Comrade discovers clusters using the &lt;code&gt;--clusters-dir&lt;/code&gt; param, docs are &lt;a href="https://moshe-1.gitbook.io/comrade/configuration/cluster-discovery" rel="nofollow"&gt;here&lt;/a&gt;, examples are &lt;a href="https://github.com/moshe/elasticsearch-comrade/tree/master/server/tests"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
Using docker (recommended)&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;docker run -v $PWD/clusters/:/app/comrade/clusters/ -it -p 8000:8000 mosheza/elasticsearch-comrade&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
Using the python package&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;pip install elasticsearch-comrade&lt;/code&gt;&lt;br&gt;
&lt;code&gt;comrade --clusters-dir clusters&lt;/code&gt;&lt;/p&gt;
&lt;h1&gt;
Installation, configuration and next steps&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://moshe-1.gitbook.io/comrade/" rel="nofollow"&gt;Here&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
&lt;a href="https://github.com/moshe/elasticsearch-comrade/milestones?state=open"&gt;Roadmap&lt;/a&gt;
&lt;/h1&gt;
&lt;h3&gt;
&lt;a href="https://github.com/moshe/elasticsearch-comrade/milestone/2"&gt;v1.1.0&lt;/a&gt;
&lt;/h3&gt;
&lt;ul class="contains-task-list"&gt;
&lt;li class="task-list-item"&gt;
 Add python package&lt;/li&gt;
&lt;li class="task-list-item"&gt;
 Reindex screen&lt;/li&gt;
&lt;li class="task-list-item"&gt;
 Comrade dashboard&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
&lt;a href="https://github.com/moshe/elasticsearch-comrade/milestone/4"&gt;v1.2.0&lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Cluster settings screen&lt;/li&gt;
&lt;li&gt;Evacuate node from shards&lt;/li&gt;
&lt;li&gt;Add commrade version indicator to footer&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
v1.3.0&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Beats screen&lt;/li&gt;
&lt;li&gt;Threadpools screen&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
Screenshots&lt;/h1&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(2).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ljlcbZRm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%282%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(5).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TKcxQmjB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%285%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(9).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cwP30_RL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%289%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(7).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cAnmuk__--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%287%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(8).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XuFJ7tQL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%288%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/moshe/elasticsearch-comrade"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;h2&gt;
  
  
  Starting up Comrade server
&lt;/h2&gt;

&lt;p&gt;You can install comrade with &lt;code&gt;pip&lt;/code&gt; / &lt;code&gt;docker&lt;/code&gt; / &lt;code&gt;source&lt;/code&gt;&lt;br&gt;
Follow the &lt;a href="https://moshe-1.gitbook.io/comrade/installation"&gt;installation guide&lt;/a&gt; for more details&lt;/p&gt;
&lt;h2&gt;
  
  
  The SQL UI
&lt;/h2&gt;

&lt;p&gt;Once you configured Comrade and started the server, click on the desired server. Next, open the navbar and click on &lt;code&gt;🔎SQL&lt;/code&gt; nav item&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QAowHJNm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/p9pb36770s9dfrdkxk4a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QAowHJNm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/p9pb36770s9dfrdkxk4a.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Sending queries and getting results
&lt;/h2&gt;

&lt;p&gt;Now, The SQL editor will show up, and you free to send you queries 🙂&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--paFT2ddi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/p4ot2o7d81bbaoeh7j2k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--paFT2ddi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/p4ot2o7d81bbaoeh7j2k.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Some things you need to know before running queries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SQL is only supported in ES version 7 and above&lt;/li&gt;
&lt;li&gt;The SQL syntax is quite standard except a few changes&lt;/li&gt;
&lt;li&gt;You can refer several indices at once using elasticsearch index &lt;a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-index.html"&gt;expansion syntax&lt;/a&gt;, for instance (Notice the second line)
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;source_node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="nv"&gt;".monitoring-es-*"&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'index_recovery'&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;source_node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt; You can apply Elasticsearch query function like match, query, and score by using them as a function
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;source_node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;SCORE&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;-- Add score to selected fields&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="nv"&gt;".monitoring-es-7-2019.12.22"&lt;/span&gt;
&lt;span class="k"&gt;where&lt;/span&gt; &lt;span class="k"&gt;MATCH&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'type'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'index_recovery'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;-- Use match query&lt;/span&gt;
&lt;span class="k"&gt;order&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="n"&gt;SCORE&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;-- order by score&lt;/span&gt;
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Found this post useful? Add a ⭐️ to my Github project nor my &lt;a href="https://twitter.com/moshe_zada"&gt;twitter profile&lt;/a&gt;🙂&lt;/strong&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/moshe"&gt;
        moshe
      &lt;/a&gt; / &lt;a href="https://github.com/moshe/elasticsearch-comrade"&gt;
        elasticsearch-comrade
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Elasticsearch admin panel built for ops and monitoring
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Elasticsearch Comrade &lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/59a2b658fd2916ebc6746e8a297037074c40f142/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6d6f7368655f7a6164613f7374796c653d736f6369616c"&gt;&lt;img src="https://camo.githubusercontent.com/59a2b658fd2916ebc6746e8a297037074c40f142/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6d6f7368655f7a6164613f7374796c653d736f6369616c" alt="Twitter Follow"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/eee1eea65c3fc767663f5dd8d85add820b4daad1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d76332e372b2d626c75652e737667"&gt;&lt;img src="https://camo.githubusercontent.com/eee1eea65c3fc767663f5dd8d85add820b4daad1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d76332e372b2d626c75652e737667" alt="python"&gt;&lt;/a&gt; &lt;a href="https://hub.docker.com/r/mosheza/elasticsearch-comrade" title="DockerHub" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/e6d5bb0f2069194456978c8a8bb53dff5982a211/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f6d6f7368657a612f656c61737469637365617263682d636f6d726164652e737667" alt="docker pulls"&gt;&lt;/a&gt; &lt;a href="https://circleci.com/gh/moshe/elasticsearch-comrade" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/8ca317b6191646b46bcc5e94513c8dc579dfd617/68747470733a2f2f636972636c6563692e636f6d2f67682f6d6f7368652f656c61737469637365617263682d636f6d726164652e7376673f7374796c653d737667" alt="CircleCI"&gt;&lt;/a&gt; &lt;a href="https://github.com/moshe/elasticsearch-comrade/issues"&gt;&lt;img src="https://camo.githubusercontent.com/c5283d35cf5bb6b8d4812fde99bd8b5b344c706f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6d6f7368652f656c61737469637365617263682d636f6d72616465" alt="GitHub issues"&gt;&lt;/a&gt; &lt;a href="https://github.com/moshe/elasticsearch-comrade/blob/master/LICENSE"&gt;&lt;img src="https://camo.githubusercontent.com/b7a58b5b7eb16c841afb0a61783f3a7c09e04df5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6f7368652f656c61737469637365617263682d636f6d72616465" alt="GitHub license"&gt;&lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;Elasticsearch Comrade is an open-source Elasticsearch admin and monitoring panel highly inspired by Cerebro.
Elasticsearch Comrade built with python3, VueJS, Sanic, Vuetify2 and Cypress
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(16).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dpus9Yhq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%2816%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/c8657e2536355c07279caa4672f145f7cd9164d9/68747470733a2f2f6d6f7368652e73682f2e6e65746c6966792f66756e6374696f6e732f696d673f736f757263653d676974687562"&gt;&lt;img src="https://camo.githubusercontent.com/c8657e2536355c07279caa4672f145f7cd9164d9/68747470733a2f2f6d6f7368652e73682f2e6e65746c6966792f66756e6374696f6e732f696d673f736f757263653d676974687562" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
Main Features&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Elasticsearch version 5,6 and 7 support (tested against elasticsearch 7.7)&lt;/li&gt;
&lt;li&gt;Multi cluster&lt;/li&gt;
&lt;li&gt;Rest API with autocompletion, history, templates, and history&lt;/li&gt;
&lt;li&gt;SQL editor (version 7 only)&lt;/li&gt;
&lt;li&gt;Built for big clusters&lt;/li&gt;
&lt;li&gt;Node statistics and monitoring&lt;/li&gt;
&lt;li&gt;Manage aliases&lt;/li&gt;
&lt;li&gt;Inspect running tasks&lt;/li&gt;
&lt;li&gt;Manage index templates&lt;/li&gt;
&lt;li&gt;Manage snapshots&lt;/li&gt;
&lt;li&gt;And much more ...&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
Quickstart&lt;/h1&gt;
&lt;h3&gt;
Cluster dir definitaions&lt;/h3&gt;
&lt;p&gt;Comrade discovers clusters using the &lt;code&gt;--clusters-dir&lt;/code&gt; param, docs are &lt;a href="https://moshe-1.gitbook.io/comrade/configuration/cluster-discovery" rel="nofollow"&gt;here&lt;/a&gt;, examples are &lt;a href="https://github.com/moshe/elasticsearch-comrade/tree/master/server/tests"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
Using docker (recommended)&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;docker run -v $PWD/clusters/:/app/comrade/clusters/ -it -p 8000:8000 mosheza/elasticsearch-comrade&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
Using the python package&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;pip install elasticsearch-comrade&lt;/code&gt;&lt;br&gt;
&lt;code&gt;comrade --clusters-dir clusters&lt;/code&gt;&lt;/p&gt;
&lt;h1&gt;
Installation, configuration and next steps&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://moshe-1.gitbook.io/comrade/" rel="nofollow"&gt;Here&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
&lt;a href="https://github.com/moshe/elasticsearch-comrade/milestones?state=open"&gt;Roadmap&lt;/a&gt;
&lt;/h1&gt;
&lt;h3&gt;
&lt;a href="https://github.com/moshe/elasticsearch-comrade/milestone/2"&gt;v1.1.0&lt;/a&gt;
&lt;/h3&gt;
&lt;ul class="contains-task-list"&gt;
&lt;li class="task-list-item"&gt;
 Add python package&lt;/li&gt;
&lt;li class="task-list-item"&gt;
 Reindex screen&lt;/li&gt;
&lt;li class="task-list-item"&gt;
 Comrade dashboard&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
&lt;a href="https://github.com/moshe/elasticsearch-comrade/milestone/4"&gt;v1.2.0&lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Cluster settings screen&lt;/li&gt;
&lt;li&gt;Evacuate node from shards&lt;/li&gt;
&lt;li&gt;Add commrade version indicator to footer&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
v1.3.0&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Beats screen&lt;/li&gt;
&lt;li&gt;Threadpools screen&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
Screenshots&lt;/h1&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(2).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ljlcbZRm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%282%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(5).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TKcxQmjB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%285%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(9).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cwP30_RL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%289%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(7).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cAnmuk__--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%287%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(8).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XuFJ7tQL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%288%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/moshe/elasticsearch-comrade"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
      <category>elasticsearch</category>
      <category>elastic</category>
      <category>sql</category>
      <category>vue</category>
    </item>
    <item>
      <title>Loop on fail - Small Pytest Trick to Boost Your Productivity</title>
      <dc:creator>Moshe Zada</dc:creator>
      <pubDate>Wed, 04 Dec 2019 09:05:36 +0000</pubDate>
      <link>https://dev.to/moshe/loop-on-fail-small-pytest-trick-to-boost-your-productivity-350n</link>
      <guid>https://dev.to/moshe/loop-on-fail-small-pytest-trick-to-boost-your-productivity-350n</guid>
      <description>&lt;p&gt;While reading &lt;code&gt;pytest-xdist&lt;/code&gt; docs I came across a very interesting flag&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-f, --looponfail    run tests in subprocess, wait for modified files
                    and re-run failing test set until all pass.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Amazing! especially if you have slow tests and you want faster feedback loop.&lt;br&gt;
All you need to do is to install the pytest-xdist plugin&lt;br&gt;
&lt;code&gt;pip install pytest-xdist&lt;/code&gt;&lt;br&gt;
and then run your tests with &lt;code&gt;-f&lt;/code&gt; switch.&lt;br&gt;
Now pytest will watch for file changes and run failing tests&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Found this post useful? Add a star⭐️ to my Github project🙂&lt;/strong&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/moshe"&gt;
        moshe
      &lt;/a&gt; / &lt;a href="https://github.com/moshe/elasticsearch-comrade"&gt;
        elasticsearch-comrade
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Elasticsearch admin panel built for ops and monitoring
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Elasticsearch Comrade &lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/59a2b658fd2916ebc6746e8a297037074c40f142/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6d6f7368655f7a6164613f7374796c653d736f6369616c"&gt;&lt;img src="https://camo.githubusercontent.com/59a2b658fd2916ebc6746e8a297037074c40f142/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6d6f7368655f7a6164613f7374796c653d736f6369616c" alt="Twitter Follow"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/eee1eea65c3fc767663f5dd8d85add820b4daad1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d76332e372b2d626c75652e737667"&gt;&lt;img src="https://camo.githubusercontent.com/eee1eea65c3fc767663f5dd8d85add820b4daad1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d76332e372b2d626c75652e737667" alt="python"&gt;&lt;/a&gt; &lt;a href="https://hub.docker.com/r/mosheza/elasticsearch-comrade" title="DockerHub" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/e6d5bb0f2069194456978c8a8bb53dff5982a211/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f6d6f7368657a612f656c61737469637365617263682d636f6d726164652e737667" alt="docker pulls"&gt;&lt;/a&gt; &lt;a href="https://circleci.com/gh/moshe/elasticsearch-comrade" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/8ca317b6191646b46bcc5e94513c8dc579dfd617/68747470733a2f2f636972636c6563692e636f6d2f67682f6d6f7368652f656c61737469637365617263682d636f6d726164652e7376673f7374796c653d737667" alt="CircleCI"&gt;&lt;/a&gt; &lt;a href="https://github.com/moshe/elasticsearch-comrade/issues"&gt;&lt;img src="https://camo.githubusercontent.com/c5283d35cf5bb6b8d4812fde99bd8b5b344c706f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6d6f7368652f656c61737469637365617263682d636f6d72616465" alt="GitHub issues"&gt;&lt;/a&gt; &lt;a href="https://github.com/moshe/elasticsearch-comrade/blob/master/LICENSE"&gt;&lt;img src="https://camo.githubusercontent.com/b7a58b5b7eb16c841afb0a61783f3a7c09e04df5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6f7368652f656c61737469637365617263682d636f6d72616465" alt="GitHub license"&gt;&lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;Elasticsearch Comrade is an open-source Elasticsearch admin and monitoring panel highly inspired by Cerebro.
Elasticsearch Comrade built with python3, VueJS, Sanic, Vuetify2 and Cypress
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(16).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dpus9Yhq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%2816%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/c8657e2536355c07279caa4672f145f7cd9164d9/68747470733a2f2f6d6f7368652e73682f2e6e65746c6966792f66756e6374696f6e732f696d673f736f757263653d676974687562"&gt;&lt;img src="https://camo.githubusercontent.com/c8657e2536355c07279caa4672f145f7cd9164d9/68747470733a2f2f6d6f7368652e73682f2e6e65746c6966792f66756e6374696f6e732f696d673f736f757263653d676974687562" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
Main Features&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Elasticsearch version 5,6 and 7 support (tested against elasticsearch 7.7)&lt;/li&gt;
&lt;li&gt;Multi cluster&lt;/li&gt;
&lt;li&gt;Rest API with autocompletion, history, templates, and history&lt;/li&gt;
&lt;li&gt;SQL editor (version 7 only)&lt;/li&gt;
&lt;li&gt;Built for big clusters&lt;/li&gt;
&lt;li&gt;Node statistics and monitoring&lt;/li&gt;
&lt;li&gt;Manage aliases&lt;/li&gt;
&lt;li&gt;Inspect running tasks&lt;/li&gt;
&lt;li&gt;Manage index templates&lt;/li&gt;
&lt;li&gt;Manage snapshots&lt;/li&gt;
&lt;li&gt;And much more ...&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
Quickstart&lt;/h1&gt;
&lt;h3&gt;
Cluster dir definitaions&lt;/h3&gt;
&lt;p&gt;Comrade discovers clusters using the &lt;code&gt;--clusters-dir&lt;/code&gt; param, docs are &lt;a href="https://moshe-1.gitbook.io/comrade/configuration/cluster-discovery" rel="nofollow"&gt;here&lt;/a&gt;, examples are &lt;a href="https://github.com/moshe/elasticsearch-comrade/tree/master/server/tests"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
Using docker (recommended)&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;docker run -v $PWD/clusters/:/app/comrade/clusters/ -it -p 8000:8000 mosheza/elasticsearch-comrade&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
Using the python package&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;pip install elasticsearch-comrade&lt;/code&gt;&lt;br&gt;
&lt;code&gt;comrade --clusters-dir clusters&lt;/code&gt;&lt;/p&gt;
&lt;h1&gt;
Installation, configuration and next steps&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://moshe-1.gitbook.io/comrade/" rel="nofollow"&gt;Here&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
&lt;a href="https://github.com/moshe/elasticsearch-comrade/milestones?state=open"&gt;Roadmap&lt;/a&gt;
&lt;/h1&gt;
&lt;h3&gt;
&lt;a href="https://github.com/moshe/elasticsearch-comrade/milestone/2"&gt;v1.1.0&lt;/a&gt;
&lt;/h3&gt;
&lt;ul class="contains-task-list"&gt;
&lt;li class="task-list-item"&gt;
 Add python package&lt;/li&gt;
&lt;li class="task-list-item"&gt;
 Reindex screen&lt;/li&gt;
&lt;li class="task-list-item"&gt;
 Comrade dashboard&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
&lt;a href="https://github.com/moshe/elasticsearch-comrade/milestone/4"&gt;v1.2.0&lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Cluster settings screen&lt;/li&gt;
&lt;li&gt;Evacuate node from shards&lt;/li&gt;
&lt;li&gt;Add commrade version indicator to footer&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
v1.3.0&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Beats screen&lt;/li&gt;
&lt;li&gt;Threadpools screen&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
Screenshots&lt;/h1&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(2).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ljlcbZRm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%282%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(5).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TKcxQmjB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%285%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(9).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cwP30_RL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%289%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(7).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cAnmuk__--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%287%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(8).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XuFJ7tQL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%288%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;

  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/moshe/elasticsearch-comrade"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



</description>
      <category>python</category>
      <category>pytest</category>
      <category>productivity</category>
      <category>tdd</category>
    </item>
    <item>
      <title>Implementing Access Control with Netlify Identity and Netlify Functions</title>
      <dc:creator>Moshe Zada</dc:creator>
      <pubDate>Tue, 19 Nov 2019 13:06:14 +0000</pubDate>
      <link>https://dev.to/moshe/implementing-access-control-with-netlify-identity-and-netlify-functions-3jpj</link>
      <guid>https://dev.to/moshe/implementing-access-control-with-netlify-identity-and-netlify-functions-3jpj</guid>
      <description>&lt;p&gt;Netlify and JAMStack becoming more popular these days. In this post, I will walk through the process of using Netlify Identity and using it in your Netlify functions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Netlify Identity
&lt;/h2&gt;

&lt;p&gt;From Netlify &lt;a href="https://docs.netlify.com/visitor-access/identity/#enable-identity-in-the-ui"&gt;docs&lt;/a&gt;:&lt;br&gt;
&lt;em&gt;Netlify Identity service brings a full suite of authentication functionality, backed by the GoTrue API. This allows you to manage and authenticate users on your site or app, without requiring them to be users of Netlify or any other service. You can use this for gated content, site administration, and more.&lt;/em&gt;&lt;br&gt;
So basically, Netlify Identity bring Authentication and user capabilities to your static site using JWT and some authentication providers like GitHub and Google&lt;/p&gt;
&lt;h2&gt;
  
  
  Enable Netlify Identity in Your Project
&lt;/h2&gt;

&lt;p&gt;To enable Identity, select the identity tab and click &lt;strong&gt;Enable Identity&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cFOzb5Vb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/uapy9eey8vwmlirk6p9r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cFOzb5Vb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/uapy9eey8vwmlirk6p9r.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Embed Identity Widget in Your Site
&lt;/h2&gt;

&lt;p&gt;For simplicity, I'm using &lt;a href="https://github.com/netlify/netlify-identity-widget"&gt;netlify-identity-widget&lt;/a&gt; provided by Netflix in order to add login modal to my site.&lt;br&gt;
Please follow the instruction from the &lt;a href="https://github.com/netlify/netlify-identity-widget"&gt;GitHub page&lt;/a&gt;, &lt;a href="https://www.netlify.com/blog/2017/09/07/introducing-built-in-identity-service-to-streamline-user-management/"&gt;Netlify's post&lt;/a&gt;, or from &lt;a href="https://github.com/netlify/netlify-identity-widget/tree/master/example"&gt;examples&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Calling Netlify Functions With the Bearer Header
&lt;/h2&gt;

&lt;p&gt;In order to make the function to know which user called the function, we need to pass the access-token we got from Netlify Identity to the function.&lt;br&gt;
Create a file called &lt;code&gt;netlify.js&lt;/code&gt;. This file will include two utility functions for calling your netlify functions - &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;POST&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getToken&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;currentUser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;netlifyIdentity&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentUser&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;currentUser&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="c1"&gt;// fetchs new JWT token only if expired&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;currentUser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;jwt&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;currentUser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;access_token&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;GET&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;getToken&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`/.netlify/functions&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Bearer &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;})).&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;POST&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;getToken&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`/.netlify/functions&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;Accept&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Bearer &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;})).&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;And use it in your frontend app when you need to call one of your functions&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;GET&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../../netlify&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;GET&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`/getData`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Getting the User Object Within Netlify Functions and Acting Upon
&lt;/h2&gt;

&lt;p&gt;Now, after you passed the &lt;code&gt;Authorization&lt;/code&gt; header, netlify will fetch the user object and put it inside the event context.&lt;br&gt;
For example, read the roles of the user:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getUserRoles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;clientContext&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userRoles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;clientContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;
      &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;clientContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;app_metadata&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;roles&lt;/span&gt;
      &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;guest&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userRoles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getUserRoles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;// Return with 401 if user is not logged in&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userRoles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;guest&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;401&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;unauthorized&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Get data only admins should see&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userRoles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;admin&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getAllStatuses&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Get data only owners should see&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userRoles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;owner&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getStatus&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Found this post useful? Add a star⭐️ to my Github project🙂&lt;/strong&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/moshe"&gt;
        moshe
      &lt;/a&gt; / &lt;a href="https://github.com/moshe/elasticsearch-comrade"&gt;
        elasticsearch-comrade
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Elasticsearch admin panel built for ops and monitoring
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Elasticsearch Comrade &lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/59a2b658fd2916ebc6746e8a297037074c40f142/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6d6f7368655f7a6164613f7374796c653d736f6369616c"&gt;&lt;img src="https://camo.githubusercontent.com/59a2b658fd2916ebc6746e8a297037074c40f142/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6d6f7368655f7a6164613f7374796c653d736f6369616c" alt="Twitter Follow"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/eee1eea65c3fc767663f5dd8d85add820b4daad1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d76332e372b2d626c75652e737667"&gt;&lt;img src="https://camo.githubusercontent.com/eee1eea65c3fc767663f5dd8d85add820b4daad1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d76332e372b2d626c75652e737667" alt="python"&gt;&lt;/a&gt; &lt;a href="https://hub.docker.com/r/mosheza/elasticsearch-comrade" title="DockerHub" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/e6d5bb0f2069194456978c8a8bb53dff5982a211/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f6d6f7368657a612f656c61737469637365617263682d636f6d726164652e737667" alt="docker pulls"&gt;&lt;/a&gt; &lt;a href="https://circleci.com/gh/moshe/elasticsearch-comrade" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/8ca317b6191646b46bcc5e94513c8dc579dfd617/68747470733a2f2f636972636c6563692e636f6d2f67682f6d6f7368652f656c61737469637365617263682d636f6d726164652e7376673f7374796c653d737667" alt="CircleCI"&gt;&lt;/a&gt; &lt;a href="https://github.com/moshe/elasticsearch-comrade/issues"&gt;&lt;img src="https://camo.githubusercontent.com/c5283d35cf5bb6b8d4812fde99bd8b5b344c706f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6d6f7368652f656c61737469637365617263682d636f6d72616465" alt="GitHub issues"&gt;&lt;/a&gt; &lt;a href="https://github.com/moshe/elasticsearch-comrade/blob/master/LICENSE"&gt;&lt;img src="https://camo.githubusercontent.com/b7a58b5b7eb16c841afb0a61783f3a7c09e04df5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6f7368652f656c61737469637365617263682d636f6d72616465" alt="GitHub license"&gt;&lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;Elasticsearch Comrade is an open-source Elasticsearch admin and monitoring panel highly inspired by Cerebro.
Elasticsearch Comrade built with python3, VueJS, Sanic, Vuetify2 and Cypress
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(16).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dpus9Yhq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%2816%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/c8657e2536355c07279caa4672f145f7cd9164d9/68747470733a2f2f6d6f7368652e73682f2e6e65746c6966792f66756e6374696f6e732f696d673f736f757263653d676974687562"&gt;&lt;img src="https://camo.githubusercontent.com/c8657e2536355c07279caa4672f145f7cd9164d9/68747470733a2f2f6d6f7368652e73682f2e6e65746c6966792f66756e6374696f6e732f696d673f736f757263653d676974687562" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
Main Features&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Elasticsearch version 5,6 and 7 support (tested against elasticsearch 7.7)&lt;/li&gt;
&lt;li&gt;Multi cluster&lt;/li&gt;
&lt;li&gt;Rest API with autocompletion, history, templates, and history&lt;/li&gt;
&lt;li&gt;SQL editor (version 7 only)&lt;/li&gt;
&lt;li&gt;Built for big clusters&lt;/li&gt;
&lt;li&gt;Node statistics and monitoring&lt;/li&gt;
&lt;li&gt;Manage aliases&lt;/li&gt;
&lt;li&gt;Inspect running tasks&lt;/li&gt;
&lt;li&gt;Manage index templates&lt;/li&gt;
&lt;li&gt;Manage snapshots&lt;/li&gt;
&lt;li&gt;And much more ...&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
Quickstart&lt;/h1&gt;
&lt;h3&gt;
Cluster dir definitaions&lt;/h3&gt;
&lt;p&gt;Comrade discovers clusters using the &lt;code&gt;--clusters-dir&lt;/code&gt; param, docs are &lt;a href="https://moshe-1.gitbook.io/comrade/configuration/cluster-discovery" rel="nofollow"&gt;here&lt;/a&gt;, examples are &lt;a href="https://github.com/moshe/elasticsearch-comrade/tree/master/server/tests"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
Using docker (recommended)&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;docker run -v $PWD/clusters/:/app/comrade/clusters/ -it -p 8000:8000 mosheza/elasticsearch-comrade&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
Using the python package&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;pip install elasticsearch-comrade&lt;/code&gt;&lt;br&gt;
&lt;code&gt;comrade --clusters-dir clusters&lt;/code&gt;&lt;/p&gt;
&lt;h1&gt;
Installation, configuration and next steps&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://moshe-1.gitbook.io/comrade/" rel="nofollow"&gt;Here&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
&lt;a href="https://github.com/moshe/elasticsearch-comrade/milestones?state=open"&gt;Roadmap&lt;/a&gt;
&lt;/h1&gt;
&lt;h3&gt;
&lt;a href="https://github.com/moshe/elasticsearch-comrade/milestone/2"&gt;v1.1.0&lt;/a&gt;
&lt;/h3&gt;
&lt;ul class="contains-task-list"&gt;
&lt;li class="task-list-item"&gt;
 Add python package&lt;/li&gt;
&lt;li class="task-list-item"&gt;
 Reindex screen&lt;/li&gt;
&lt;li class="task-list-item"&gt;
 Comrade dashboard&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
&lt;a href="https://github.com/moshe/elasticsearch-comrade/milestone/4"&gt;v1.2.0&lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Cluster settings screen&lt;/li&gt;
&lt;li&gt;Evacuate node from shards&lt;/li&gt;
&lt;li&gt;Add commrade version indicator to footer&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
v1.3.0&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Beats screen&lt;/li&gt;
&lt;li&gt;Threadpools screen&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
Screenshots&lt;/h1&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(2).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ljlcbZRm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%282%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(5).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TKcxQmjB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%285%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(9).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cwP30_RL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%289%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(7).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cAnmuk__--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%287%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master//docs/.gitbook/assets/image%20(8).png?raw=true"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XuFJ7tQL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/moshe/elasticsearch-comrade/master/docs/.gitbook/assets/image%2520%288%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;

  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/moshe/elasticsearch-comrade"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;🥳&lt;/p&gt;

</description>
      <category>netlify</category>
      <category>security</category>
      <category>javascript</category>
      <category>jwt</category>
    </item>
    <item>
      <title>Remove accidentally pushed file from a git repository history in 4 simple steps</title>
      <dc:creator>Moshe Zada</dc:creator>
      <pubDate>Fri, 15 Nov 2019 12:29:01 +0000</pubDate>
      <link>https://dev.to/moshe/remove-accidentally-pushed-file-from-a-git-repository-history-in-4-simple-steps-18cg</link>
      <guid>https://dev.to/moshe/remove-accidentally-pushed-file-from-a-git-repository-history-in-4-simple-steps-18cg</guid>
      <description>&lt;p&gt;Although git offers &lt;a href="https://git-scm.com/docs/gitignore" rel="noopener noreferrer"&gt;gitignore&lt;/a&gt; mechanism for ignoring files from being committed to git, you may find yourself stuck with a big file in your repo&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmoshe.sh%2F.netlify%2Ffunctions%2Fimg%3Fsource%3Ddevto%26post%3Dbigfile" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmoshe.sh%2F.netlify%2Ffunctions%2Fimg%3Fsource%3Ddevto%26post%3Dbigfile" title="Optional Title" alt="Alt text"&gt;&lt;/a&gt;&lt;br&gt;
Simply deleting the file with &lt;code&gt;rm&lt;/code&gt; is not enough, git records all the history of &lt;strong&gt;all&lt;/strong&gt; of your branches &lt;strong&gt;forever&lt;/strong&gt; in the &lt;code&gt;.git&lt;/code&gt; directory at the root of your project.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step #1: Backup your repo!
&lt;/h3&gt;

&lt;p&gt;Simply copy the project directory&lt;br&gt;
&lt;code&gt;cp -r myproject backup&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Step #2: Identify the commit that introduced the new file
&lt;/h3&gt;

&lt;p&gt;The easiest way is to look at the output of &lt;code&gt;git log&lt;/code&gt; command, assuming you want to delete a file called &lt;code&gt;client/public/favicons/red/hugefile.ova&lt;/code&gt; run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git log client/public/favicons/red/hugefile.ova
Sat Aug 17 19:16:17 2019 +0300 7ff66fa Add favicons  &lt;span class="o"&gt;[&lt;/span&gt;Moshe Zada]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;As you can see, it seems like commit &lt;code&gt;7ff66fa&lt;/code&gt; introduced the big file, let's rewrite the history!&lt;/p&gt;
&lt;h3&gt;
  
  
  Step #3: Go back in time
&lt;/h3&gt;

&lt;p&gt;Now that we find the commit that we want to return back to, run&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git rebase --interactive 7ff66fa~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Right after running this command, your editor will open up with the commit history from 7ff66fa to the last commit, for example:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pick 7ff66fa Add favicons
pick 48d9cc0 Readme &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="c"&gt;#84)&lt;/span&gt;
pick b9f23fd GitBook: &lt;span class="o"&gt;[&lt;/span&gt;master] 17 pages modified
pick 1e0f4f1 move to docs
pick 23adabf GitBook: &lt;span class="o"&gt;[&lt;/span&gt;master] 4 pages modified
pick 237c792 revert readme
pick 9418698 Continue reload &lt;span class="k"&gt;if &lt;/span&gt;had exception
pick 3723c3c Add Copy option to index
pick 1ff0ec1 Add filter &lt;span class="k"&gt;for &lt;/span&gt;manage aliases
pick 8a8770d Better null message
pick 4d8b64c Subscribe to input change
pick 9bc31b6 Save more data &lt;span class="k"&gt;for &lt;/span&gt;node stats
pick 546e10b Small fixes

&lt;span class="c"&gt;# Rebase 5058e82..eafa06e onto 5058e82 (193 commands)&lt;/span&gt;
&lt;span class="c"&gt;#&lt;/span&gt;
&lt;span class="c"&gt;# Commands:&lt;/span&gt;
&lt;span class="c"&gt;# p, pick &amp;lt;commit&amp;gt; = use commit&lt;/span&gt;
&lt;span class="c"&gt;# r, reword &amp;lt;commit&amp;gt; = use commit, but edit the commit message&lt;/span&gt;
&lt;span class="c"&gt;# e, edit &amp;lt;commit&amp;gt; = use commit, but stop for amending&lt;/span&gt;
&lt;span class="c"&gt;# s, squash &amp;lt;commit&amp;gt; = use commit, but meld into previous commit&lt;/span&gt;
&lt;span class="c"&gt;# f, fixup &amp;lt;commit&amp;gt; = like "squash", but discard this commit's log message&lt;/span&gt;
&lt;span class="c"&gt;# x, exec &amp;lt;command&amp;gt; = run command (the rest of the line) using shell&lt;/span&gt;
&lt;span class="c"&gt;# b, break = stop here (continue rebase later with 'git rebase --continue')&lt;/span&gt;
&lt;span class="c"&gt;# d, drop &amp;lt;commit&amp;gt; = remove commit&lt;/span&gt;
&lt;span class="c"&gt;# l, label &amp;lt;label&amp;gt; = label current HEAD with a name&lt;/span&gt;
&lt;span class="c"&gt;# t, reset &amp;lt;label&amp;gt; = reset HEAD to a label&lt;/span&gt;
&lt;span class="c"&gt;# m, merge [-C &amp;lt;commit&amp;gt; | -c &amp;lt;commit&amp;gt;] &amp;lt;label&amp;gt; [# &amp;lt;oneline&amp;gt;]&lt;/span&gt;
&lt;span class="c"&gt;# .       create a merge commit using the original merge commit's&lt;/span&gt;
&lt;span class="c"&gt;# .       message (or the oneline, if no original merge commit was&lt;/span&gt;
&lt;span class="c"&gt;# .       specified). Use -c &amp;lt;commit&amp;gt; to reword the commit message.&lt;/span&gt;
&lt;span class="c"&gt;#&lt;/span&gt;
&lt;span class="c"&gt;# These lines can be re-ordered; they are executed from top to bottom.&lt;/span&gt;
&lt;span class="c"&gt;#&lt;/span&gt;
&lt;span class="c"&gt;# If you remove a line here THAT COMMIT WILL BE LOST.&lt;/span&gt;
&lt;span class="c"&gt;#&lt;/span&gt;
&lt;span class="c"&gt;# However, if you remove everything, the rebase will be aborted.&lt;/span&gt;
&lt;span class="c"&gt;#&lt;/span&gt;
&lt;span class="c"&gt;# Note that empty commits are commented out&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;go to the first line, the one that starts with your git commit and change the first word to the letter e - for edit (vimmiers: &lt;code&gt;cwe&amp;lt;ESC&amp;gt;&lt;/code&gt;) and exit your editor (&lt;code&gt;:wq&lt;/code&gt;)&lt;/p&gt;
&lt;h3&gt;
  
  
  Step #4: Rewrite the history and push your changes
&lt;/h3&gt;

&lt;p&gt;Now git will start replaying the last commits and give you shell just before the bad commit&lt;br&gt;
delete the file:&lt;br&gt;
&lt;code&gt;rm client/public/favicons/red/hugefile.ova&lt;/code&gt;&lt;br&gt;
Add the change to git&lt;br&gt;
&lt;code&gt;git add client/public/favicons/red/hugefile.ova&lt;/code&gt;&lt;br&gt;
Commit and continue the rebase&lt;br&gt;
&lt;code&gt;git commit --amend '-S' &amp;amp;&amp;amp; git rebase --continue&lt;/code&gt;&lt;br&gt;
Verify changes and push your changes&lt;/p&gt;

&lt;p&gt;Thank Joe and Eugene for pointing &lt;code&gt;git push --force&lt;/code&gt; should be used with caution&lt;br&gt;
&lt;em&gt;git push -f be carful with this. the -f stands for force. Be default git will complain if you try to re-write history, but you can force it to go anyway. If you are on a solo project this should be fine, but if you are working on a team make sure no one has pulled the branch and added commits on top of it You won't be doing them any favors.&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Don't be afraid to use it. Just make sure you communicate with your team on what is being done.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push --force&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That's it 🙂&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Found this post useful? Add a star⭐️ to my Github project🙂&lt;/strong&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/moshe" rel="noopener noreferrer"&gt;
        moshe
      &lt;/a&gt; / &lt;a href="https://github.com/moshe/elasticsearch-comrade" rel="noopener noreferrer"&gt;
        elasticsearch-comrade
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Elasticsearch admin panel built for ops and monitoring
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Elasticsearch Comrade &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/46786e2dcdee83924be31791d4c3dd8747d782c63487f9561185772c2189c894/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6d6f7368655f7a6164613f7374796c653d736f6369616c"&gt;&lt;img src="https://camo.githubusercontent.com/46786e2dcdee83924be31791d4c3dd8747d782c63487f9561185772c2189c894/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6d6f7368655f7a6164613f7374796c653d736f6369616c" alt="Twitter Follow"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/c00817fa19e039d3c015fe5b89dbe31de0ae8db439170c8e31072e0f4b206422/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d76332e372b2d626c75652e737667"&gt;&lt;img src="https://camo.githubusercontent.com/c00817fa19e039d3c015fe5b89dbe31de0ae8db439170c8e31072e0f4b206422/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d76332e372b2d626c75652e737667" alt="python"&gt;&lt;/a&gt; &lt;a href="https://hub.docker.com/r/mosheza/elasticsearch-comrade" title="DockerHub" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/81dfcaf90ec744f42fffbec5bce8d3a765f9fd49be381176eecfd0b229169bc5/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f6d6f7368657a612f656c61737469637365617263682d636f6d726164652e737667" alt="docker pulls"&gt;&lt;/a&gt; &lt;a href="https://circleci.com/gh/moshe/elasticsearch-comrade" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/6d91e164740df4e075e337b09e1de33e2d0a371b1786fe48e3fbb8a53c3fdd88/68747470733a2f2f636972636c6563692e636f6d2f67682f6d6f7368652f656c61737469637365617263682d636f6d726164652e7376673f7374796c653d737667" alt="CircleCI"&gt;&lt;/a&gt; &lt;a href="https://github.com/moshe/elasticsearch-comrade/issues" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/f27e0bba25d4615b1647b6b012f1ba37e74eb8954a93794c959b3d81428ca3c4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6d6f7368652f656c61737469637365617263682d636f6d72616465" alt="GitHub issues"&gt;&lt;/a&gt; &lt;a href="https://github.com/moshe/elasticsearch-comrade/blob/master/LICENSE" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/cb36479b4c5aac793fd2bd343c3850b5b491f1b0f7538ed8cbf45ca0aec7fc71/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6f7368652f656c61737469637365617263682d636f6d72616465" alt="GitHub license"&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;/div&gt;

&lt;p&gt;Elasticsearch Comrade is an open-source Elasticsearch admin and monitoring panel highly inspired by Cerebro.
Elasticsearch Comrade built with python3, VueJS, Sanic, Vuetify2 and Cypress
&lt;a rel="noopener noreferrer" href="https://github.com/moshe/elasticsearch-comrade/docs/.gitbook/assets/image%20(16).png?raw=true"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmoshe%2Felasticsearch-comrade%2Fdocs%2F.gitbook%2Fassets%2Fimage%2520%2816%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/fb00919ad59a3b2213b6de5e02db577c0d76929e0d923f7b5c886600fde864cb/68747470733a2f2f6d6f7368652e73682f2e6e65746c6966792f66756e6374696f6e732f696d673f736f757263653d676974687562"&gt;&lt;img src="https://camo.githubusercontent.com/fb00919ad59a3b2213b6de5e02db577c0d76929e0d923f7b5c886600fde864cb/68747470733a2f2f6d6f7368652e73682f2e6e65746c6966792f66756e6374696f6e732f696d673f736f757263653d676974687562" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Main Features&lt;/h1&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Elasticsearch version 5,6 and 7 support (tested against elasticsearch 7.7)&lt;/li&gt;
&lt;li&gt;Multi cluster&lt;/li&gt;
&lt;li&gt;Rest API with autocompletion, history, templates, and history&lt;/li&gt;
&lt;li&gt;SQL editor (version 7 only)&lt;/li&gt;
&lt;li&gt;Built for big clusters&lt;/li&gt;
&lt;li&gt;Node statistics and monitoring&lt;/li&gt;
&lt;li&gt;Manage aliases&lt;/li&gt;
&lt;li&gt;Inspect running tasks&lt;/li&gt;
&lt;li&gt;Manage index templates&lt;/li&gt;
&lt;li&gt;Manage snapshots&lt;/li&gt;
&lt;li&gt;And much more ...&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Quickstart&lt;/h1&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Cluster dir definitaions&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;Comrade discovers clusters using the &lt;code&gt;--clusters-dir&lt;/code&gt; param, docs are &lt;a href="https://moshe-1.gitbook.io/comrade/configuration/cluster-discovery" rel="nofollow noopener noreferrer"&gt;here&lt;/a&gt;, examples are &lt;a href="https://github.com/moshe/elasticsearch-comrade/tree/master/server/tests" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Using docker (recommended)&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;&lt;code&gt;docker run -v $PWD/clusters/:/app/comrade/clusters/ -it -p 8000:8000 mosheza/elasticsearch-comrade&lt;/code&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Using the python package&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;&lt;code&gt;pip install elasticsearch-comrade&lt;/code&gt;&lt;br&gt;
&lt;code&gt;comrade --clusters-dir clusters&lt;/code&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Installation, configuration and next steps&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="https://moshe-1.gitbook.io/comrade/" rel="nofollow noopener noreferrer"&gt;Here&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;&lt;a href="https://github.com/moshe/elasticsearch-comrade/milestones?state=open" rel="noopener noreferrer"&gt;Roadmap&lt;/a&gt;&lt;/h1&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;&lt;a href="https://github.com/moshe/elasticsearch-comrade/milestone/2" rel="noopener noreferrer"&gt;v1.1.0&lt;/a&gt;&lt;/h3&gt;

&lt;/div&gt;
&lt;ul class="contains-task-list"&gt;
&lt;li class="task-list-item"&gt;
 Add python package&lt;/li&gt;
&lt;li class="task-list-item"&gt;
 Reindex screen&lt;/li&gt;
&lt;li class="task-list-item"&gt;
 Comrade dashboard&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;&lt;a href="https://github.com/moshe/elasticsearch-comrade/milestone/4" rel="noopener noreferrer"&gt;v1.2.0&lt;/a&gt;&lt;/h3&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Cluster settings screen&lt;/li&gt;
&lt;li&gt;Evacuate node from shards&lt;/li&gt;
&lt;li&gt;Add commrade version indicator to footer&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;v1.3.0&lt;/h3&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Beats screen&lt;/li&gt;
&lt;li&gt;Threadpools screen&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Screenshots&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/moshe/elasticsearch-comrade/docs/.gitbook/assets/image%20(2).png?raw=true"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmoshe%2Felasticsearch-comrade%2Fdocs%2F.gitbook%2Fassets%2Fimage%2520%282%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/moshe/elasticsearch-comrade/docs/.gitbook/assets/image%20(5).png?raw=true"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmoshe%2Felasticsearch-comrade%2Fdocs%2F.gitbook%2Fassets%2Fimage%2520%285%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/moshe/elasticsearch-comrade/docs/.gitbook/assets/image%20(9).png?raw=true"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmoshe%2Felasticsearch-comrade%2Fdocs%2F.gitbook%2Fassets%2Fimage%2520%289%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/moshe/elasticsearch-comrade/docs/.gitbook/assets/image%20(7).png?raw=true"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmoshe%2Felasticsearch-comrade%2Fdocs%2F.gitbook%2Fassets%2Fimage%2520%287%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/moshe/elasticsearch-comrade/docs/.gitbook/assets/image%20(8).png?raw=true"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmoshe%2Felasticsearch-comrade%2Fdocs%2F.gitbook%2Fassets%2Fimage%2520%288%29.png%3Fraw%3Dtrue" alt="Alt text" title="Optional Title"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/moshe/elasticsearch-comrade" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>Loading CSVs to elasticsearch like a pro (no Logstash needed)</title>
      <dc:creator>Moshe Zada</dc:creator>
      <pubDate>Mon, 09 Sep 2019 13:11:42 +0000</pubDate>
      <link>https://dev.to/moshe/loading-csvs-to-elasticsearch-like-a-pro-no-logstash-needed-3n</link>
      <guid>https://dev.to/moshe/loading-csvs-to-elasticsearch-like-a-pro-no-logstash-needed-3n</guid>
      <description>&lt;p&gt;As an Elasticsearch user, I subscribed to elasticsearch groups and channels in many places (Twitter, Reddit, Facebook, StackOverflow) and I keep seeing people struggling to start with elasticsearch, especially loading bunch of CSV files into it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hey does anyone know how can i upload multiple CSV files to Kibana?
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The first mistake as I see it is to use Logstash in order to load CSV files to elasticsearch.&lt;br&gt;
I see Logstash as a streaming service to elasticsearch rather than a tool to load data to elasticsearch from a static source (like CSV).&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Elasticsearch Loader to load CSVs to Elasticsearch
&lt;/h2&gt;

&lt;p&gt;I wrote a wrapper on top of Elasticsearch's bulk API in order to reduce the barrier in loading files into Elasticsearch.&lt;br&gt;
The usage simple as running a command from your terminal.&lt;/p&gt;

&lt;h3&gt;
  
  
  Install
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;pip install elasticsearch-loader&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Plugins
&lt;/h3&gt;

&lt;p&gt;There are several plugins like Parquet, Redis, and S3 as input sources, read more about them in the &lt;a href="https://github.com/moshe/elasticsearch_loader"&gt;readme&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Usage and examples
&lt;/h3&gt;

&lt;p&gt;Load CSVs into elasticsearch running on localhost&lt;br&gt;
&lt;code&gt;elasticsearch_loader --index incidents csv file1.csv file2.csv&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Load CSV from URL and specify id field&lt;br&gt;
&lt;code&gt;elasticsearch_loader --index data --id-field state csv https://raw.githubusercontent.com/jakevdp/data-USstates/master/state-abbrevs.csv&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Read CSV data from stdin&lt;br&gt;
&lt;code&gt;generate_data | elasticsearch_loader --index data csv -&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And much more, for more examples and documantaion please follow &lt;a href="https://github.com/moshe/elasticsearch_loader"&gt;elasticsearch-loader's README file&lt;/a&gt;&lt;/p&gt;

</description>
      <category>elasticsearch</category>
      <category>logstash</category>
      <category>devops</category>
      <category>database</category>
    </item>
  </channel>
</rss>
