<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Elasticsearch on Lin's Blog</title><link>https://coder.tw/en/tags/elasticsearch/</link><description>Recent content in Elasticsearch on Lin's Blog</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Thu, 19 Jan 2017 02:18:24 +0000</lastBuildDate><atom:link href="https://coder.tw/en/tags/elasticsearch/index.xml" rel="self" type="application/rss+xml"/><item><title>Querying a Date Field in Kibana</title><link>https://coder.tw/en/posts/kibana-date-type-field-query/</link><pubDate>Thu, 19 Jan 2017 02:18:24 +0000</pubDate><guid>https://coder.tw/en/posts/kibana-date-type-field-query/</guid><description>&lt;p&gt;When you want to search for data within a certain period in Kibana, the first thing that comes to mind is the built-in Time Picker. It is really handy. But in some cases your data may have more than one date field, and you have to filter with a query instead of the Time Picker. For example, with email data: sending, opening, and clicking each send a log to my server. That gives you two times, one for when the email was sent and one for when the event happened (such as opening or clicking). In a case like this, you may need to search on a date field in the search box.&lt;/p&gt;</description></item><item><title>WTF Elastic X-Pack License - How to uninstall X-Pack</title><link>https://coder.tw/en/posts/wtf-elastic-x-pack-license-how-to-uninstall-x-pack/</link><pubDate>Mon, 16 Jan 2017 10:30:47 +0000</pubDate><guid>https://coder.tw/en/posts/wtf-elastic-x-pack-license-how-to-uninstall-x-pack/</guid><description>&lt;p&gt;If you found this article through a search engine, you probably feel the same resentment toward X-Pack that I do. At first I thought X-Pack was a free, handy plugin, so I installed it on both Elasticsearch and Kibana. Then 30 days later a message appeared saying the license had expired and I needed to &amp;ldquo;renew the license key,&amp;rdquo; otherwise I couldn&amp;rsquo;t log into Kibana. Up to that point I still assumed I just needed to register an account to get a new license key. But after browsing the official site for a long time, I couldn&amp;rsquo;t find any text about licensing, pricing, or purchasing (later I found out it does exist — in tiny print&amp;hellip; do you people even want to make money?). In the end I only found the pricing page through a Google search.&lt;/p&gt;</description></item><item><title>Setting Up User Authentication for Elasticsearch and Kibana</title><link>https://coder.tw/en/posts/elasticsearch-kibana-user-auth/</link><pubDate>Sun, 15 Jan 2017 10:00:51 +0000</pubDate><guid>https://coder.tw/en/posts/elasticsearch-kibana-user-auth/</guid><description>&lt;p&gt;After you install Elasticsearch and Kibana, you will quickly run into a serious problem: &amp;ldquo;Wait, where are the username and password?&amp;rdquo; That&amp;rsquo;s right, Elasticsearch and Kibana don&amp;rsquo;t come with the usual user management module. You can only restrict access by binding them to an internal IP or port. But if you&amp;rsquo;re like my company and don&amp;rsquo;t have a fixed IP, or you want to set up several accounts, keep reading. This post shares how to set up basic user authentication for Elasticsearch and Kibana using HTTP Auth.&lt;/p&gt;</description></item><item><title>String Split in Elasticsearch Script Field (Painless)</title><link>https://coder.tw/en/posts/string-split-in-elasticsearch-script-field-painless/</link><pubDate>Wed, 14 Dec 2016 01:29:14 +0000</pubDate><guid>https://coder.tw/en/posts/string-split-in-elasticsearch-script-field-painless/</guid><description>&lt;p&gt;If you found this article, you have probably been searching for how to use Split in an Elasticsearch (or Kibana) Script Field for a long time! I deliberately included every keyword I could think of, so that engineers who suffer like I did do not waste too much of their lives on this&amp;hellip;&lt;/p&gt;
&lt;p&gt;To cut to the chase: although Painless claims to support the Java Native API, a few things are not supported, and one of them is split. The story goes that the Elasticsearch developers felt the time complexity of split was too poor, so they cut it out. I did not know this at first, and I tried all kinds of approaches, from doubting whether my syntax was correct to wondering whether some special syntax was needed to import the Java API. Finally, on an Elasticsearch Issue, I found this post: [&lt;a href="https://github.com/elastic/elasticsearch/issues/20952"&gt;Painless - Request for native String split function&lt;/a&gt;], and my feelings at that moment were&amp;hellip;&amp;hellip;&lt;/p&gt;</description></item><item><title>How to Make elasticsearch.py Fast (Bulk Operations)</title><link>https://coder.tw/en/posts/how-to-make-elasticsearch-py-fast-bulk-operate/</link><pubDate>Thu, 08 Dec 2016 00:57:01 +0000</pubDate><guid>https://coder.tw/en/posts/how-to-make-elasticsearch-py-fast-bulk-operate/</guid><description>&lt;p&gt;When you work with Elasticsearch in Python, you will inevitably install the official &lt;a href="https://elasticsearch-py.readthedocs.io/en/master/"&gt;elasticsearch.py&lt;/a&gt; library. Recently, while using Python to receive email logs and write them into Elasticsearch, I picked up quite a few lessons worth sharing. As everyone knows, AWS Lambda charges by execution time, so when writing Lambda functions every second counts. Anything that ran over 0.5 seconds had me in agony. So I went from inserting records one at a time with .index, to using streaming_bulk, and finally, unable to stand it anymore, mixing parallel_bulk with streaming_bulk. Here I will talk about the differences between these approaches and the pitfalls I ran into!&lt;/p&gt;</description></item></channel></rss>