<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Search Nuggets &#187; Christoffer Vig</title>
	<atom:link href="http://blog.comperiosearch.com/blog/author/cvig/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.comperiosearch.com</link>
	<description>A blog about Search as THE solution</description>
	<lastBuildDate>Mon, 13 Jun 2016 08:59:45 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.9.40</generator>
	<item>
		<title>ELK stack deployment with Ansible</title>
		<link>http://blog.comperiosearch.com/blog/2015/11/26/elk-stack-deployment-with-ansible/</link>
		<comments>http://blog.comperiosearch.com/blog/2015/11/26/elk-stack-deployment-with-ansible/#comments</comments>
		<pubDate>Thu, 26 Nov 2015 09:59:38 +0000</pubDate>
		<dc:creator><![CDATA[Christoffer Vig]]></dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ansible]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[Elasticsearch]]></category>
		<category><![CDATA[elk]]></category>
		<category><![CDATA[Kibana]]></category>
		<category><![CDATA[logstash]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=3999</guid>
		<description><![CDATA[As human beings, we like to believe that each and every one of us is a special individual, and not easily replaceable. That may be fine, but please, don’t fall into the habit of treating your computer the same way. Ansible is a free software platform for configuring and managing computers, and I’ve been using [...]]]></description>
				<content:encoded><![CDATA[<p><img class="alignright" src="http://www.ansible.com/hs-fs/hub/330046/file-767051897-png/Official_Logos/ansible_circleA_red.png?t=1448391213471" alt="" width="251" height="251" />As human beings, we like to believe that each and every one of us is a special individual, and not easily replaceable. That may be fine, but please, don’t fall into the habit of treating your computer the same way.</p>
<p><span id="more-3999"></span></p>
<p><a href="https://en.wikipedia.org/wiki/Ansible_(software)"><b>Ansible</b> </a>is a <a href="https://en.wikipedia.org/wiki/Free_software">free software</a> platform for configuring and managing computers, and I’ve been using it a lot lately to manage the ELK stack. Elasticsearch, Logstash and Kibana.</p>
<p>I can define a list of servers I want to manage in a YAML config file &#8211; the so called inventory:</p><pre class="crayon-plain-tag">[elasticearch-master]
es-master1.mydomain.com
es-master2.mydomain.com
es-master3.mydomain.com

[elasticsearch-data]
elk-data1.mydomain.com
elk-data2.mydomain.com
elk-data3.mydomain.com

[kibana]
kibana.mydomain.com</pre><p>And define the roles for the servers in another YAML config file &#8211; the so called playbook:</p><pre class="crayon-plain-tag">- hosts: elasticsearch-master
  roles:
    - ansible-elasticsearch

- hosts: elasticsearch-data
  roles:
    - ansible-elasticsearch

- hosts: logstash
  roles:
    - ansible-logstash

- hosts: kibana
  roles:
    - ansible-kibana</pre><p>&nbsp;</p>
<p>Each group of servers may have their own files containing configuration variables.</p><pre class="crayon-plain-tag">elasticsearch_version: 2.1.0
elasticsearch_node_master: false
elasticsearch_heap_size: 1000G</pre><p>&nbsp;</p>
<p>Ansible is used for configuring the ELK stack vagrant box at <a href="https://github.com/comperiosearch/vagrant-elk-box-ansible">https://github.com/comperiosearch/vagrant-elk-box-ansible</a>, which was recently upgraded with Elasticsearch 2.1, Kibana 4.3 and Logstash 2.1</p>
<p>The same set of Ansible roles can be applied when the configuration needs to move into production, by applying another set of variable files with modified host names, certificates and such. The possible ways to do this are several.</p>
<p><b>How does it work?</b></p>
<p>Ansible is agent-less. This means, you do not install anything (an agent) on the machines you control. Ansible needs only to be installed on the controlling machine (Linux/OSX) and  connects to the managed machines (some support for windows, even) using SSH. The only requirement on the managed machines is python.</p>
<p>Happy ansibling!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2015/11/26/elk-stack-deployment-with-ansible/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Elasticsearch: Shield protected Kibana with Active Directory</title>
		<link>http://blog.comperiosearch.com/blog/2015/08/21/elasticsearch-security-shield/</link>
		<comments>http://blog.comperiosearch.com/blog/2015/08/21/elasticsearch-security-shield/#comments</comments>
		<pubDate>Fri, 21 Aug 2015 14:26:45 +0000</pubDate>
		<dc:creator><![CDATA[Christoffer Vig]]></dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Elasticsearch]]></category>
		<category><![CDATA[enterprise]]></category>
		<category><![CDATA[Kibana]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=3245</guid>
		<description><![CDATA[Elasticsearch easily stores terabytes of data, but how can you make sure users only see the data they should? This post will explore how to use Shield, a plugin for Elasticsearch, to authenticate users with Active Directory. Elasticsearch will by default allow anyone access to all data. The Shield plugin allows locking down Elasticsearch using authentication [...]]]></description>
				<content:encoded><![CDATA[<p>Elasticsearch easily stores terabytes of data, but how can you make sure users only see the data they should? This post will explore how to use Shield, a plugin for Elasticsearch, to authenticate users with Active Directory.</p>
<p><span id="more-3245"></span><br />
<a title="NO TRESPASSING" href="https://www.flickr.com/photos/mike2099/2058021162/in/photolist-48RTZu-4ttdcn-4YPqqU-5WbRAP-8rYugF-XsCao-ftZ1hL-dpmFB-dqyeUE-bjV3VY-bEMba3-bEMb6w-84YCqg-rf5Yk1-8Yjaj3-chg68s-4KDN1M-4KDMWF-5MfWjA-tCJt6J-8nxBiZ-6YsUyh-KfDRK-54uLmy-bv1Pv-oChdLk-pL3X8t-4RTTjd-dhfUPn-cEkCFY-czjXiE-m1zThD-dzESFD-oj2KUM-c16MV-72dTxS-g4Yky4-kK9YR-p6DYnY-5HJvrX-8aovPQ-dhfVkP-bwB8c-gFzTXk-7zd9iF-eua6KC-2gzEc-8nxtcH-2gzEb-fnp3zH" data-flickr-embed="true"><img src="https://farm3.staticflickr.com/2059/2058021162_ed7b6e8d72_b.jpg" alt="NO TRESPASSING" width="600" /></a><script src="//embedr.flickr.com/assets/client-code.js" async="" charset="utf-8"></script></p>
<p>Elasticsearch will by default allow anyone access to all data. The <a href="https://www.elastic.co/guide/en/shield/current/introduction.html">Shield</a> plugin allows locking down Elasticsearch using authentication from the internal esusers realm, Active Directory (AD)  or LDAP . Using AD, you can map groups defined in your Windows domain to roles in Elasticsearch. For instance, you can allow people in the Fishery department access only to  fish-indexes, and give complete control to anyone in the IT department.</p>
<p>To use Shield in production, you have to buy an Elasticsearch subscription, however, you get a 30-day trial when installing the license manager. So let&#8217;s hurry up and see how this works out in Kibana.</p>
<p>&nbsp;</p>
<p>In this post, we will install Shield and connect to Active Directory (AD) for authentication. After having made sure we can authenticate with AD, we will add SSL encryption everywhere possible. We will add authentication for the Kibana server using the built in authentication realm esusers, and if time allows at the end, we will create two user groups, each with access to its own index, and check how it all looks when accessed in Kibana 4.</p>
<p>&nbsp;</p>
<h3>Prerequisites</h3>
<p>You will need a previously installed Elasticsearch and Kibana. The most recent versions should work, I have used Elasticsearch 1.7 and Kibana 4.1.1  If you need a machine to test on, I can personally recommend the vagrant-elk-box you can find <a href="https://github.com/comperiosearch/vagrant-elk-box-ansible">here</a>: <strong>The following guide assumes the file locations of the vagrant-elk-box</strong>, if you install differently, you will probably know where to look. Ask an adult for help.</p>
<p>For Active Directory, you need to be on a domain that uses Active Directory. That would probably mean some kind of Windows work environment.</p>
<p>&nbsp;</p>
<h4>Installing Shield</h4>
<p>If you&#8217;re on the vagrant box you should begin the lesson by entering the vagrant box using the commands</p><pre class="crayon-plain-tag">vagrant up
vagrant ssh</pre><p>&nbsp;</p>
<p>Install the license manager</p><pre class="crayon-plain-tag"> sudo /usr/share/elasticsearch/bin/plugin -i elasticsearch/license/latest</pre><p>Install Shield</p><pre class="crayon-plain-tag"> sudo /usr/share/elasticsearch/bin/plugin -i elasticsearch/shield/latest</pre><p>Restart elasticsearch. (service elasticsearch restart)</p>
<p>Check out the logs,  you should find some information regarding when your Shield license will expire (logfile location:  /var/log/elasticsearch/vagrant-es.log)</p>
<h4>Integrating Active Directory</h4>
<p>The next step involves figuring out a thing or two about your Active Directory configuration. First of all you need to know the address. Now you need to be on  your windows machine, open cmd.exe and type</p><pre class="crayon-plain-tag">set LOGONSERVER</pre><p>The name of your AD should pop back.  Add a section similar to the following into the elasticsearch.yml file (at /etc/elasticsearch/elasticsearch.yml)</p><pre class="crayon-plain-tag">shield.authc.realms:
  active_directory:
    type: active_directory
    domain_name: superdomain.com
    unmapped_groups_as_roles: true
    url: ldap://ad.superdomain.com</pre><p>Type in the address to your AD in the url: field (where it says url: ldap://ad.superdomain.com). If your logonserver is ad.cnn.com, you should type in url: ldap://ad.cnn.com</p>
<p>Also, you need to figure out your domain name and type it in correctly.</p>
<p>NB: Be careful with the indenting! Elasticsesarch cares a lot about correct indenting, and may even refuse to start without telling you why if you make a mistake.</p>
<h5>Finding the Correct name for the Active Directory group</h5>
<p>Next step involves figuring out the name for the Group you wish to grant access to. You may have called your group &#8220;Fishermen&#8221;, but that is probably not exactly what it&#8217;s called in AD.</p>
<p>Microsoft has a very simple and nice tool called <a href="https://technet.microsoft.com/en-us/library/bb963907.aspx">Active Directory Explorer</a> . Open the tool and enter the adress you just found from the LOGONSERVER (remember? it&#8217;s only 10 lines above)</p>
<p>You may have to click and explore a little to find the groups you want. Once you find it, you need the value for the &#8220;distinguishedName&#8221; attribute. You can double click on it and copy out from the &#8220;Object&#8221;.</p>
<p>This is an example from my AD</p><pre class="crayon-plain-tag">CN=Rolle IT,OU=Groups,OU=Oslo,OU=Comperiosearch,DC=comperiosearch,DC=com</pre><p>Now this value represents a group which we want to map to a role in elasticsearch.</p>
<p>Open the file /etc/elasticsearch/shield/role-mapping.yml. It should look similar to this</p><pre class="crayon-plain-tag"># Role mapping configuration file which has elasticsearch roles as keys
# that map to one or more user or group distinguished names

#roleA:   this is an elasticsearch role
#  - groupA-DN  this is a group distinguished name
#  - groupB-DN
#  - user1-DN   this is the full user distinguished name
power_user:
  - "CN=Rolle IT,OU=Groups,OU=Oslo,OU=Comperiosearch,DC=comperiosearch,DC=com"
#user:
# - "cn=admins,dc=example,dc=com" 
# - "cn=John Doe,cn=other users,dc=example,dc=com"</pre><p>I have uncommented the line with &#8220;power_user:&#8221; and added a line below containing the distinguishedName from above.</p>
<p>By restarting elasticsearch, anyone in the &#8220;Rolle IT&#8221; group should now be able to log in (and nobody else (yet)).</p>
<p>To test it out, open <a href="http://localhost:9200">http://localhost:9200</a> in your browser. You should be presented with a login box where you can type in your username/password. In case of failure, check out the elasticsearch logs (at /var/log/elasticsearch/vagrant-es.log).</p>
<p>If you were able to log in, that means Active Directory authentication works. Congratulations!  You deserve a refreshment. Some strong coffee, will go down well with the next sections, where we add encrypted communications everywhere we can.</p>
<h3>SSL  - Elasticsearch</h3>
<p>Authentication and encrypted communication go hand in hand. Without SSL, username and password is transferred in plaintext on the wire. For this demo we will use self-signed certificates. Keytool comes with Java, and is used to handle certificates for Elasticsearch.  The following command will generate a self-signed certficate and put it in a JKS file named self-signed.jks. (swap out  $password with your preferred password)</p><pre class="crayon-plain-tag">keytool -genkey -keyalg RSA -alias selfsigned -keystore self-signed.jks -keypass $password -storepass $password -validity 360 -keysize 2048 -dname "CN=localhost, OU=orgUnit, O=org, L=city, S=state, C=NO"</pre><p>Copy the certificate into /etc/elasticsearch/</p>
<p>Modify  /etc/elasticsearch/elasticsearch.yml by adding the following lines:</p><pre class="crayon-plain-tag">shield.ssl.keystore.path: /etc/elasticsearch/self-signed.jks
shield.ssl.keystore.password: $password
shield.ssl.hostname_verification: false
shield.transport.ssl: true
shield.http.ssl: true</pre><p>(use the same password as you used when creating the self-signed certificate )</p>
<p>Restart Elasticsearch again, and watch the logs for failures.</p>
<p>Try to open https://localhost:9200 in your browser (NB: httpS not http)</p>
<div id="attachment_3905" style="width: 310px" class="wp-caption alignright"><img class="wp-image-3905 size-medium" src="http://blog.comperiosearch.com/wp-content/uploads/2015/08/your-connection-is-not-private-e1440146932126-300x181.png" alt="your connection is not private" width="300" height="181" /><p class="wp-caption-text">https://localhost:9200</p></div>
<p>You should a screen warning you that something is wrong with the connection. This is a good sign! It means your certificate is actually working! For production use you could use your own CA or buy a proper certificate, which both will avoid the ugly warning screen.</p>
<h4>SSL &#8211; Active directory</h4>
<p>Our current method of connecting to Active Directory is unencrypted &#8211; we need to enable SSL for the AD connections.</p>
<p>1. Fetch the certificate from your Active Directory server (replace ldap.example.com with the LOGONSERVER from above)</p><pre class="crayon-plain-tag">echo | openssl s_client -connect ldap.example.com:6362&gt;/dev/null| openssl x509 &gt; ldap.crt</pre><p>2. Import the certificate into your keystore (located at /etc/elasticsearch/)</p><pre class="crayon-plain-tag">keytool -import-keystore self-signed.jks -file ldap.crt</pre><p>&nbsp;</p>
<p>3. Modify AD url in elasticsearch.yml<br />
change the line</p><pre class="crayon-plain-tag">url: ldap://ad.superdomain.com</pre><p>to</p><pre class="crayon-plain-tag">url: ldaps://ad.superdomain.com</pre><p>Restart elasticsearch and check logs for failures</p>
<h4>Kibana authentication with esusers</h4>
<p>With Elasticsearch locked down by Shield, it means no services can search or post data either. Including Kibana and Logstash.</p>
<p>Active Directory is great, but I&#8217;m not sure I want to use it for letting the Kibana server talk to Elasticsearch. We can use the Shield built in user management system, esusers. Elasticsearch comes with a set of predefined roles, including roles for Logstash, Kibana4 server and Kibana4 user. (/etc/elasticsearch/shield/role-mapping.yml on the vagrant-elk box if you&#8217;re still on that one).</p>
<p>Add a new kibana4_server user, granting it the role kibana4_server, using this command:</p><pre class="crayon-plain-tag">cd /usr/share/elasticsearch/bin/shield  
./esusers useradd kibana4_server -p secret -r kibana4_server</pre><p></p>
<h4></h4>
<h4>Adding esusers realm</h4>
<p>The esusers realm is the default one, and does not need to be configured if that&#8217;s the only realm you use. Now since we added the Active Directory realm we must add another section to the elasticsearch.yml file from above.</p>
<p>It should end up looking like this</p><pre class="crayon-plain-tag">shield.authc.realms:
  esusers:
    type: esusers
    order: 0
  active_directory:
    order: 1
    type: active_directory
    domain_name: superdomain.com
    unmapped_groups_as_roles: true
    url: ldap://ad.superdomain.com</pre><p>The order parameter defines in what order elasticsearch should try the various authentication mechanisms.</p>
<h4>Allowing Kibana to access Elasticsearch</h4>
<p>Kibana must be informed of the new user we just created. You will find the kibana configuration file at /opt/kibana/config/kibana.yml.</p>
<p>Add in the username and password you just created. You also need to change the address for elasticsearch to using https</p><pre class="crayon-plain-tag"># The Elasticsearch instance to use for all your queries.
elasticsearch_url: "https://localhost:9200"

# If your Elasticsearch is protected with basic auth, this is the user credentials
# used by the Kibana server to perform maintence on the kibana_index at statup. Your Kibana
# users will still need to authenticate with Elasticsearch (which is proxied thorugh
# the Kibana server)
kibana_elasticsearch_username: kibana4_server
kibana_elasticsearch_password: secret</pre><p>Restart kibana and elasticsearch, and watch the logs for any errors. Try opening Kibana at  http://localhost:5601, type in your login and password. Provided you&#8217;re in the group you gave access earlier, you should be able to login.</p>
<h4></h4>
<h4>Creating SSL for Kibana</h4>
<p>Once you have enabled authorization for Elasticsearch, you really need to set SSL certificates for Kibana as well. This is also configured in kibana.yml</p><pre class="crayon-plain-tag">verify_ssl: false
# SSL for outgoing requests from the Kibana Server (PEM formatted)
ssl_key_file: "kibana_ssl_key_file"
ssl_cert_file: "kibana_ssl_cert_file"</pre><p>You can create a self-signed key and cert file for kibana using the following command:</p><pre class="crayon-plain-tag">openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes</pre><p>&nbsp;</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2015/08/kibana-auth.png"><img class="alignright size-medium wp-image-3920" src="http://blog.comperiosearch.com/wp-content/uploads/2015/08/kibana-auth-300x200.png" alt="kibana auth" width="300" height="200" /></a></p>
<h4>Configuring AD groups for Kibana access</h4>
<p>Unfortunately, this part of the post is going to be very sketchy, as we are desperately running out of time. This blog is much too long already.</p>
<p>Elasticsearch already comes with a list of predefined roles, among which you can find the kibana4 role.  The kibana4 role allows read/write access to the .kibana index, in addition to search and read access to all indexes. We want to limit access to just one index for each AD group. The fishery group shall only access the fishery index, and the finance group shall only acess the finance index. We can create roles that limit access to one index by copying the kibana4 role, giving it an appropriate name and changing the index:&#8217;*&#8217; section to map to only the preferred index.</p>
<p>The final step involves mapping the Elasticsearch role into an AD role. This is done in the role_mapping.yml file, as mentioned above.</p>
<p>Only joking of course, that wasn&#8217;t the last step. The last step is restarting Elasticsearch, and checking the logs for failures as you try to log in.</p>
<p>&nbsp;</p>
<h3>Securing Elasticsearch</h3>
<p>Shield brings enterprise authentication to Elasticsearch. You can easily manage access to various parts of  Elasticsearch management and data by using Active Directory groups.</p>
<p>This has been a short dive into the possibilities, make sure to contact Comperio if you should need  help in creating a solution with Elasticsearch and Shield.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2015/08/21/elasticsearch-security-shield/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Impressions from Berlin Buzzwords 2015</title>
		<link>http://blog.comperiosearch.com/blog/2015/06/08/impressions-from-berlin-buzzwords-2015/</link>
		<comments>http://blog.comperiosearch.com/blog/2015/06/08/impressions-from-berlin-buzzwords-2015/#comments</comments>
		<pubDate>Mon, 08 Jun 2015 13:34:53 +0000</pubDate>
		<dc:creator><![CDATA[Christoffer Vig]]></dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Apache Flink]]></category>
		<category><![CDATA[bbuzz]]></category>
		<category><![CDATA[berlin buzzwords]]></category>
		<category><![CDATA[Big Data]]></category>
		<category><![CDATA[Elasticsearch]]></category>
		<category><![CDATA[Kafka]]></category>
		<category><![CDATA[lucene]]></category>
		<category><![CDATA[Solr]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=3720</guid>
		<description><![CDATA[May 31 &#8211; June 3 2015 Stream processing, Internet of things, Real time analytics, Big data, Recommendations, Machine learning. Berlin Buzzwords undoubtedly lives up to its name by presenting the frontlines of data technology trends. The conference is focused on three core concepts &#8211; search, data and scale, bringing together a diverse range of people [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2015/06/andre-bbuzz-beyond-significant-terms.png"><img src="http://blog.comperiosearch.com/wp-content/uploads/2015/06/andre-bbuzz-beyond-significant-terms-300x194.png" alt="andre-bbuzz-beyond-significant-terms" width="300" height="194" class="alignright size-medium wp-image-3741" /></a>May 31 &#8211; June 3 2015</p>
<p></a>Stream processing, Internet of things, Real time analytics, Big data, Recommendations, Machine learning. <a href="http://berlinbuzzwords.de/">Berlin Buzzwords</a> undoubtedly lives up to its name by presenting the frontlines of data technology trends.<br />
<span id="more-3720"></span><br />
The conference is focused on three core concepts &#8211; search, data and scale, bringing together a diverse range of people and with presentations touching the perimeter of the buzzword range.<br />
Berlin Buzzwords kicked off on Sunday evening with a Barcamp, Monday and Tuesday contained full day conferences, while Wednesday was filled with hackathons and workshops.</p>
<h3>Comperio</h3>
<p>Comperio was one of the many companies sponsoring the conference, and came to Berlin bringing two speakers. André Lynum talked about “Beyond Significant terms” &#8211; a deep dive into how to utilize Elasticsearch built in indexes and APIs  for improved lexical analysis, topic management and trend information. André’s talk went far beyond what the well known Elasticsearch significant terms aggregation provides. Christoffer Vig captured a spot on the informal Open Stage, giving a funny and off-kilter presentation and demo of the analytics and visualization capabilities of Kibana 4 based on a beer product catalogue.</p>
<h3>The talks</h3>
<p>Many people attended the comparison of Solr and Elasticsearch Performance &#038; Scalability with Radu Gheorghe &#038; Rafał Kuć from Sematext. This was a fast paced run through of how they were able to create tests reproducing the same conditions on both search engines. Elasticsearch outperformed Solr on text search using wikipedia data, while, surprisingly Solr outperformed Elasticsearch on aggregations. Solr has recently started catching up with Elasticsearch on providing nested aggregations and perhaps the improved performance comes as a result of a slimmed down implementation? It will be very interesting to follow the developments of both platforms into the future, and as consumers of the products we see competition is a good thing driving innovation and performance.</p>
<p>Two other interesting technical talks was Adrian Grands explaining some of the algorithms behind Elasticsearchs aggregations and Ted Dunnings presentation of the t-digest algorithm. Both were a window into how approximations can yield fast algorithms for complex statistics with provable bounds which they managed to keep approachable to the casual listener.</p>
<h3>SQL?</h3>
<p>Another theme threatening to return from the basement was how to properly support SQL style joins into search engines.  Real life use cases sometimes demand objects with relations. The stock answer from the NoSQL world is to denormalize your data before inserting it, but Lucene/Elasticsearch/Solr did get limited Join support a while ago. Taking this further Mikhail Khludnev showed how the new Global Ordinal Join aims to provide a Join with improved performance.</p>
<h3>Talking the talk</h3>
<p>As search consultants one of our main challenges at Comperio is communicating about technical topics with customers who need to connect technical topics to their own competence and background. Ellen Friedman from MapR explained how such communication can be beneficial to almost any team or team member and shared some experiences and ideas regarding how you can try this at home. At its core it boils down to understanding and describing your technical work across several layers and showing respect for the perspective and background your conversation partner.<br />
She also shared a very funny parrot joke. Not going to reveal that one here, watch the video if you’ld like a good laugh.</p>
<h3>Hackathon</h3>
<p>Comperio also attended the Apache Flink workshop hosted at Google’s offices in Berlin by the talented developers at data Artisans. Apache Flink is in some ways similar to Apache Spark and other recent distributed computing frameworks, and is an alternative to Hadoop&#8217;s MapReduce component.  It represents a novel approach to data processing, modelling all data as streams, exposing both a batch- and stream APIs. Apache Flink has a built in optimizer that optimizes memory, network traffic and processing power. This leaves the developer to implement core functionality in Java, Scala or Python.</p>
<h3>The buzz</h3>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2015/06/berlinbuzzwordsLogo.png"><img src="http://blog.comperiosearch.com/wp-content/uploads/2015/06/berlinbuzzwordsLogo-300x176.png" alt="berlinbuzzwordsLogo" width="300" height="176" class="alignright size-small wp-image-3726" /></a><br />
Berlin Buzzwords is a great opportunity to surf the crest of the big data wave with the most interesting people in the field. The city of Berlin with it’s sense of being on the edge of new developments provides the perfect backdrop for a conference on the latest “Buzzwords”. Comperio will certainly be back next year.</p>
<p>Videos from most talks are available at <a href="https://www.youtube.com/playlist?list=PLq-odUc2x7i-_qWWixXHZ6w-MxyLxEC7s">youtube.com</a></p>
<p><b>Beyond significant terms</b></p>
<p><iframe width="500" height="281" src="https://www.youtube.com/embed/yYFFlyHPGlg?feature=oembed" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></p>
<p><b>Algorithms and data-structures that power Lucene and Elasticsearch</b></p>
<p><iframe width="500" height="281" src="https://www.youtube.com/embed/eQ-rXP-D80U?feature=oembed" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></p>
<p><b>Practical t-digest Applications</b></p>
<p><iframe width="500" height="281" src="https://www.youtube.com/embed/CR4-aVvjE6A?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p><b>Talk the Talk: How to Communicate with the Non-Coder</b></p>
<p><iframe width="500" height="281" src="https://www.youtube.com/embed/Je-X850t_L8?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p><b>Side by Side with Elasticsearch &#038; Solr part 2</b></p>
<p><iframe width="500" height="281" src="https://www.youtube.com/embed/01mXpZ0F-_o?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2015/06/08/impressions-from-berlin-buzzwords-2015/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analyzing web server logs with Elasticsearch in the cloud</title>
		<link>http://blog.comperiosearch.com/blog/2015/05/26/analyzing-weblogs-with-elasticsearch-in-the-cloud/</link>
		<comments>http://blog.comperiosearch.com/blog/2015/05/26/analyzing-weblogs-with-elasticsearch-in-the-cloud/#comments</comments>
		<pubDate>Tue, 26 May 2015 21:12:34 +0000</pubDate>
		<dc:creator><![CDATA[Christoffer Vig]]></dc:creator>
				<category><![CDATA[Elasticsearch]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[found by elastic]]></category>
		<category><![CDATA[Kibana]]></category>
		<category><![CDATA[logstash]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=3702</guid>
		<description><![CDATA[Using Logstash and Kibana on Found by Elastic, Part 1 This is part one of a two post blog series, aiming to demonstrate how to feed logs from IIS into Elasticsearch and Kibana via Logstash, using the hosted services provided by Found by Elastic. This post will deal with setting up the basic functionality and [...]]]></description>
				<content:encoded><![CDATA[<h2>Using Logstash and Kibana on Found by Elastic, Part 1</h2>
<p>This is part one of a two post blog series, aiming to demonstrate how to feed logs from IIS into Elasticsearch and Kibana via Logstash, using the hosted services provided by Found by Elastic. This post will deal with setting up the basic functionality and securing connections. Part 2 will show how to configure Logstash to read from IIS log files, and how to use Kibana 4 to visualize web traffic. Originally published on the <a href="https://www.found.no/foundation/analyzing-weblogs-with-elasticsearch/">Elastic Blog</a><br />
<span id="more-3702"></span></p>
<h4>Getting the Bits</h4>
<p>For this demo I will be running Logstash and Kibana from my Windows laptop.<br />
If you want to follow along, download and extract Logstash 1.5.RC4 or later, and Kibana 4.0.2 or later from <a href="https://www.elastic.co/downloads">https://www.elastic.co/downloads</a>.</p>
<h4>Creating an Elasticsearch Cluster</h4>
<p>Creating a new trial cluster in Found is just a matter of logging in and pressing a button. It takes a few seconds until the cluster is ready, and a screen with some basic information on how to connect pops up. We need the address for the HTTPS endpoint, so copy that out.</p>
<h4>Configuring Logstash</h4>
<p>Now, with the brand new SSL connection option in Logstash, connecting to Found is as simple as this Logstash configuration</p><pre class="crayon-plain-tag">input { stdin{} }

output {
  elasticsearch {
    protocol =&gt; http
    host =&gt; REPLACE_WITH_FOUND_CLUSTER_HOSTNAME
    port =&gt; "9243" # Check the port also
    ssl =&gt; true
  }

  stdout { codec =&gt; rubydebug }
}</pre><p>&nbsp;</p>
<p>Save the file as found.conf</p>
<p>Start up Logstash using</p><pre class="crayon-plain-tag">bin\logstash.bat agent --verbose -f found.conf</pre><p>You should see a message similar to</p><pre class="crayon-plain-tag">Create client to elasticsearch server on `https://....foundcluster.com:9243`: {:level=&amp;gt;:info}</pre><p>Once you see &#8220;Logstash startup completed&#8221; type in your favorite test term on the terminal. Mine is &#8220;fisk&#8221; so I type that.<br />
You should see output on your screen showing what Logstash intends to pass on to elasticsearch.</p>
<p>We want to make sure this actually hits the cloud, so open a browser window and paste the HTTPS link from before, append <code>/_search</code> to the URL and hit enter.<br />
You should now see the search results from your newly created Elasticsearch cluster, containing the favorite term you just typed in. We have a functioning connection from Logstash on our machine to Elasticsearch in the cloud! Congratulations!</p>
<h4>Configuring Kibana 4</h4>
<p>Kibana 4 comes with a built-in webserver. The configuration is done in a kibana.yml file in the config directory. Connecting to Elasticsearch in the cloud comes down to inserting the address of the Elasticsearch instance.</p><pre class="crayon-plain-tag"># The Elasticsearch instance to use for all your queries.
elasticsearch_url: `https://....foundcluster.com:9243`</pre><p>Of course, we need to verify that this really works, so we open up Kibana on <a href="http://localhost:5601">http://localhost:5601</a>, select the Logstash index template, with the @timestamp data field as suggested, and open up the discover panel. Now, if there was less than 15 minutes since you inserted your favorite test term in Logstash (previous step), you should see it already. Otherwise, change the date range by clicking on the selector in the top right corner.</p>
<p><img class="alignleft" src="https://raw.githubusercontent.com/babadofar/MyOwnRepo/master/images/kibanatest.png" alt="Kibana test" width="1090"  /></p>
<h4>Locking it down</h4>
<p>Found by Elastic has worked hard to make the previous steps easy. We created an Elasticsearch cluster, fed data into it and displayed in Kibana in less than 5 minutes. We must have forgotten something!? And yes, of course! Something about security. We made sure to use secure connections with SSL, and the address generated for our cluster contains a 32 character long, randomly generated list of characters, which is pretty hard to guess. Should, however, the address slip out of our hands, hackers could easily delete our entire cluster. And we don’t want that to happen. So let’s see how we can make everything work when we add some basic security measures.</p>
<h4>Access Control Lists</h4>
<p>Found by Elastic has support for access control lists, where you can set up lists of usernames and passwords, with lists of rules that deny/allow access to various paths within Elasticsearch. This makes it easy to create a &#8220;read only&#8221; user, for instance, by creating a user with a rule that only allows access to the <code>/_search</code> path. Found by Elastic has a sample configuration with users searchonly and readwrite. We will use these as starting point but first we need to figure out what Kibana needs.</p>
<h4>Kibana 4 Security</h4>
<p>Kibana 4 stores its configuration in a special index, by default named &#8220;.kibana&#8221;. The Kibana webserver needs write access to this index. In addition, all Kibana users need write access to this index, for storing dashboards, visualizations and searches, and read access to all the indices that it will query. More details about the access demands of Kibana 4 can be found on the <a href="http://www.elastic.co/guide/en/shield/current/_shield_with_kibana_4.html">elastic blog</a>.</p>
<p>For this demo, we will simply copy the “readwrite” user from the sample twice, naming one kibanaserver, the other kibanauser.</p><pre class="crayon-plain-tag">Setting Access Control in Found:
# Allow everything for the readwrite-user, kibanauser and kibanaserver
- paths: ['.*']
conditions:
- basic_auth:
users:
- readwrite
- kibanauser
- kibanaserver
- ssl:
require: true
action: allow</pre><p>Press save and the changes are immediately effective. Try to reload the Kibana at <a href="http://localhost:5601">http://localhost:5601</a>, you should be denied access.</p>
<p>Open up the kibana.yml file from before and modify it:</p><pre class="crayon-plain-tag"># If your Elasticsearch is protected with basic auth, this is the user credentials
# used by the Kibana server to perform maintence on the kibana_index at statup. Your Kibana
# users will still need to authenticate with Elasticsearch (which is proxied thorugh
# the Kibana server)
kibana_elasticsearch_username: kibanaserver
kibana_elasticsearch_password: `KIBANASERVER_USER_PASSWORD`</pre><p>Stop and start Kibana to effectuate settings.<br />
Now when Kibana starts up, you will be presented with a login box for HTTP authentication.<br />
Type in kibanauser as the username, and the password . You should now again be presented with the Discover screen, showing the previously entered favorite test term. Again, you may have to expand the time range to see your entry.</p>
<h4>Logstash Security</h4>
<p>Logstash will also need to supply credentials when connecting to Found by Elastic. We reuse permission from the readwrite user once again, this time giving the name &#8220;logstash&#8221;.<br />
It is simply a matter of supplying the username and password in the configuration file.</p><pre class="crayon-plain-tag">output {
  elasticsearch {
    ….
    user =&gt; “logstash”,
    password =&gt; `LOGSTASH_USER_PASSWORD`
  }
}</pre><p></p>
<h4>Wrapping it up</h4>
<p>This has been a short dive into Logstash and Kibana with Found by Elastic. The recent changes done in order to support the Shield plugin for Elasticsearch, Logstash and Kibana, make it very easy to use the secure features of Found by Elastic. In the next post we will look into feeding logs from IIS into Elasticsearch via Logstash, and visualizing the most used query terms in Kibana.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2015/05/26/analyzing-weblogs-with-elasticsearch-in-the-cloud/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ny versjon av Comperio FRONT.NET</title>
		<link>http://blog.comperiosearch.com/blog/2015/05/13/ny-versjon-av-comperio-front-net/</link>
		<comments>http://blog.comperiosearch.com/blog/2015/05/13/ny-versjon-av-comperio-front-net/#comments</comments>
		<pubDate>Wed, 13 May 2015 10:24:54 +0000</pubDate>
		<dc:creator><![CDATA[Christoffer Vig]]></dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Comperio Front]]></category>
		<category><![CDATA[enterprise search]]></category>
		<category><![CDATA[logstash]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=3661</guid>
		<description><![CDATA[Comperio har gjennom tidenes løp levert over 100 søkeprosjekter. Tankegods, svette og erfaringer hentet fra dette arbeidet har krystallisert seg inn i vår egentuviklede programvare for søkeapplikasjoner: FRONT. Tidligere i vår lanserte vi versjon 5 av Java-FRONT, denne gang er det den noe yngre fetteren Comperio FRONT.NET som har fått ligge på operasjonsbordet. Hovedtrekkene i [...]]]></description>
				<content:encoded><![CDATA[<p>Comperio har gjennom tidenes løp levert over 100 søkeprosjekter. Tankegods, svette og erfaringer hentet fra dette arbeidet har krystallisert seg inn i vår egentuviklede programvare for søkeapplikasjoner: FRONT. Tidligere i vår lanserte vi versjon 5 av Java-FRONT, denne gang er det den noe yngre fetteren Comperio FRONT.NET som har fått ligge på operasjonsbordet. Hovedtrekkene i den nye versjonen er nye søkeadaptere, forbedret stabilitet og ytelse, samt forbedret logging.<br />
<span id="more-3661"></span></p>
<h4>Mellomvare for søk</h4>
<p>FRONT.NET opererer som mellomvare, og lar deg konfigurere forretningslogikk for søk uavhengig av både søkemotor og presentasjon. FRONT.NET er laget for å kunne hente og sette sammen informasjon fra ulike kilder, og kan gjerne kalles en søkeorkestrator.</p>
<p>FRONT.NET lar deg skille mellom forretningslogikk og applikasjonslogikk. Applikasjoner som trenger søkefunksjonalitet trenger ikke bry seg med kompliserte søkeuttrykk, men sender simpelthen spørreord over til FRONT.NET. Trenger du å avgrense søket, kan du sende med filter, som for eksempel brukerinformasjon, sted, avdeling, eller lignende. De komplekse spørringene tar FRONT seg av.</p>
<h4>Søkemotoruavhengighet</h4>
<p>FRONT.NET tilbyr et generelt format for spørringer, og søkeresultater. Dataformatet fra FRONT er det samme, uavhengig av om motoren i bakkant er SharePoint, ESP, eller Solr. FRONT.NET har i dag adaptere for Fast ESP, SharePoint 2010 og 2013, Elasticsearch, Solr og Google Search Appliance. Dette gjør det enkelt å sette sammen resultater fra ulike søkemotorer. Dersom du ønsker å bytte ut søkemotoren trenger det ikke innebære endringer i din applikasjon, da det kun er snakk om å bytte ut søkeadapter i FRONT.NET. Nye adaptere utvikles så snart vi ser behovet melde seg.</p>
<h4>Elasticsearch adapter</h4>
<p>Elasticsearch er en søkemotor i stor vekst. Til utvikling av Elasticsearch adapteret har vi kunnet dra nytte av NEST, den offisielle .NET klienten for Elasticsearch. Elasticsearch har enorm fleksibilitet i forhold til hvordan spørringer kan uttrykkes, med mulighet for nestede boolske uttrykk og dynamiske ranking-funksjoner. I utvikling av adapteret har vi valgt å minimere kompleksiteten i FRONT ved å delegere disse mulighetene inn i Elasticsearch via søkemaler (search templates). Dette ivaretar fleksibiliteten, samtidig som APIer og programmeringsgrensesnittene er beholdt.</p>
<h4>Google Search Appliance Adapter</h4>
<p>Comperio ble ifjor partner med Google, og vi har nå utviklet FRONT.NET adapter for Googles intranett søkemotor Google Search Appliance, eller bare GSA for kort. GSA tilbyr enkel integrasjon mot en rekke ulike kilder, søkegrensesnittet er enkelt og forholde seg til og adapteret har støtte for alle vanlige søkeoperasjoner.</p>
<h4>Logging</h4>
<p>For å kunne utvikle en god søkeløsning er det avgjørende at man har tilgang til gode søkelogger som avslører hvordan søkeapplikasjon brukes.<br />
FRONT.NET har nylig fått funksjonalitet for å kunne logge direkte til Logstash. Logstash kombinert med Elasticsearch og Kibana gir deg et kraftig verktøy for dataanalyse.</p>
<h4>FRONTD</h4>
<p>Versjon 5 av FRONT.NET kjører som en frittstående tjeneste i Windows.<br />
Tidligere versjoner opererte som web applikasjon under IIS (Internet information server), men vi ser at når vi kjører frittstående oppnås forenklet administrasjon, samt forbedret stabilitet og ytelse.</p>
<h4>Microsoft, .NET og veien videre</h4>
<p>Microsoft og .NET verdenen er under rivende utvikling for tiden, ikke minst gjennom Microsoft sin nye og kjært velkomne åpning mot open source. Vi liker veldig godt ideen om kryssplattform .NET, og neste versjon av FRONT.NET vil forhåpentligvis kjøre like bra på OS X og Linux som på Microsoft.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2015/05/13/ny-versjon-av-comperio-front-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3 steg til Big Data</title>
		<link>http://blog.comperiosearch.com/blog/2015/04/28/3-steg-til-big-data/</link>
		<comments>http://blog.comperiosearch.com/blog/2015/04/28/3-steg-til-big-data/#comments</comments>
		<pubDate>Tue, 28 Apr 2015 13:00:09 +0000</pubDate>
		<dc:creator><![CDATA[Christoffer Vig]]></dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Big Data]]></category>
		<category><![CDATA[Elasticsearch]]></category>
		<category><![CDATA[Kibana]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[søk]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=3609</guid>
		<description><![CDATA[Big data er tidens tredje hotteste buzzword, men ikke alle er klar over hva det er, hvor de kan finne det, eller hva man skal med det. Big Data er i ferd med å vokse frem under beina på de fleste av oss. Det digitale universet fordobles for annet hvert år som går.  Internett, mobil og ikke minst tingenes [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Big data</strong> er tidens <a href="http://www.languagemonitor.com/words-of-the-year-woty/the-top-business-buzzwords-of-global-english-for-2014">tredje hotteste buzzword</a>, men ikke alle er klar over hva det er, hvor de kan finne det, eller hva man skal med det. Big Data er i ferd med å vokse frem under beina på de fleste av oss. Det digitale universet fordobles for annet hvert år som går.  Internett, mobil og ikke minst tingenes internett genererer stadig mer informasjon.</p>
<p>Skal du lykkes i forretningslivet i dag, er du avhengig av å kjenne brukernes bevegelser og kunne tilpasse løsningen din etter dette. Du kan velge å stole på maktene, som Snåsamannen eller Märtha, eller du kan ta makten i din egen hånd og høste innsikten som ligger begravet i virksomhetens og brukernes logger.</p>
<h3><strong>3 steg</strong></h3>
<p>Vi tar utgangspunkt i at du har en nettside, og at du får tak i loggene til denne. I tillegg trenger du en datamaskin, samt en datakyndig person, helst en med utvikler-kompetanse.</p>
<p><strong>Slik kommer du i gang:</strong></p>
<ol>
<li><strong>Identifiser 3 målbare KPI’er</strong>.<br />
Forslag: Sidevisninger pr. dag, Mest brukte spørreord, Responstid pr.side</li>
<li><strong>Mat loggene inn i ELK</strong>.<br />
Finn logdata og en utvikler. Utvikleren finner lett ut av dette.</li>
<li><strong>Visualisér KPI’ene</strong>.<br />
Hold fast i utvikleren, mens dere sammen ser på dataene i Kibana og finner passende grafisk fremstilling.<br/></li>
</ol>
<div id="attachment_3606" style="width: 310px" class="wp-caption alignnone"><a href="http://blog.comperiosearch.com/wp-content/uploads/2015/04/Comperio_bigdata.png"><img class="wp-image-3606 size-medium" src="http://blog.comperiosearch.com/wp-content/uploads/2015/04/Comperio_bigdata-300x203.png" alt="Comperio_bigdata" width="300" height="203" /></a><p class="wp-caption-text">Eksempel på Kibana dashboard</p></div>
<p><strong>KPI</strong></p>
<p>Forslagene til KPIer er standard måletall for nettsider. Dette er tall som alle nettsideanalyseverktøy, som Google Analytics, kan gi deg i dag. Forskjellen er at nå er det du som setter sammen grafene og utvikler verktøyene,  dataene tilhører deg, og måten du velger å sette informasjonen sammen på for å skape innsikt er helt opp til deg selv. Igjen; Hensikten her er å demonstrere en teknikk og vise fram et verktøy, ikke å fortelle deg hvilke KPIer du bør være opptatt av.</p>
<p><strong>ELK</strong></p>
<p><a href="https://www.elastic.co/"><strong>ELK </strong></a><strong>, som nevnt over, eller </strong>den såkalte “ELK stacken”, tilbyr et komplett Big Data lagrings-, søk- og analyse-verktøy. ELK står for Elasticsearch, Logstash og Kibana, en samling open source produkter utviklet av teknologiselskapet Elastic. Søkemotoren Elasticsearch er kjernen i stacken, med fokus på utviklervennlighet og skalerbarhet. Logstash mater data inn i Elasticsearch, mens Kibana tilbyr ad-hoc data-analyse og nydelige visualiseringer og grafer.</p>
<p>Netflix, GitHub, Microsoft er eksempler på gigantvirksomheter som benytter Elasticsearch i kjernen av sin virksomhet.</p>
<p>Bakgrunnen til plattformens popularitet ligger i at den er enkel å starte med, samtidig som den leverer uovertrufne søke- og analyse-muligheter.  ELK stacken nevnes ofte i samme åndedrag som Big Data, ettersom den takler større  datamengder.</p>
<p>&nbsp;</p>
<h3><strong>En start</strong></h3>
<p>Loggene til nettsiden din kvalifisere antakeligvis ikke helt til betegnelsen Big Data. Poenget er at verktøykassen vi introduserer  her står du rustet til større oppgaver.</p>
<p>Du kan kan komme i gang med å ta makten over bedriftens datalogger uten at det krever store ressurser. Planen kan legges underveis, samtidig som enkel tilgang til rådata alene kan skape både ny innsikt og nye spørsmål og behov.</p>
<p>Søk og analyse av store datamengder, som f.eks. transaksjonslogger, nettverkstrafikk, brannmur, internett-aktivitet i stor skale, som twitter, irc, nettsider osv.</p>
<p>Det norske søketeknologiselskapet <a href="http://www.comperio.no">Comperio</a> er partner med Elastic, og har mange utviklere som du kan hjelpe deg gjennom disse tre stegene. Comperio har jobbet med søk siden 2004 og er et av verdens ledende selskaper innen søketeknologi.</p>
<p><strong>Ikke la Big Data skuta seile sin egen sjø, ta plass ved roret og sett kursen mot din egen Big Data horisont nå!</strong></p>
<p>&nbsp;</p>
<p><em>Les om Comperios frokostmøte <a href="https://www.eventbrite.com/e/comperio-frokost-sk-og-jakten-pa-den-gode-vinen-tickets-16052734160">om hvordan forstå kundene dine bedre</a>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2015/04/28/3-steg-til-big-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to develop Logstash configuration files</title>
		<link>http://blog.comperiosearch.com/blog/2015/04/10/how-to-develop-logstash-configuration-files/</link>
		<comments>http://blog.comperiosearch.com/blog/2015/04/10/how-to-develop-logstash-configuration-files/#comments</comments>
		<pubDate>Fri, 10 Apr 2015 12:06:17 +0000</pubDate>
		<dc:creator><![CDATA[Christoffer Vig]]></dc:creator>
				<category><![CDATA[Elasticsearch]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[elastic]]></category>
		<category><![CDATA[logs]]></category>
		<category><![CDATA[logstash]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=3471</guid>
		<description><![CDATA[Installing logstash is easy. Problems arrive only once you have to configure it. This post will reveal some of the tricks the ELK team at Comperio has found helpful. Write configuration on the command line using the -e flag If you want to test simple filter configurations, you can enter it straight on the command [...]]]></description>
				<content:encoded><![CDATA[<p>Installing logstash is easy. Problems arrive only once you have to configure it. This post will reveal some of the tricks the ELK team at Comperio has found helpful.</p>
<h4><span id="more-3471"></span>Write configuration on the command line using the -e flag</h4>
<p>If you want to test simple filter configurations, you can enter it straight on the command line using the -e flag.</p><pre class="crayon-plain-tag">bin\logstash.bat  agent  -e 'filter{mutate{add_field =&gt; {"fish" =&gt; “salmon”}}}'</pre><p>After starting logstash with the -e flag, simply type your test input into the console. (The defaults for input and output are stdin and stdout, so you don’t have to specify it. )</p>
<h4>Test syntax with &#8211;configtest</h4>
<p>After modifying the configuration, you can make logstash check correct syntax of the file, by using the &#8211;configtest (or -t) flag on the command line.</p>
<h4>Use stdin and stdout in the config file</h4>
<p>If your filter configurations are more involved, you can use input stdin and output stdout. If you need to pass a json object into logstash, you can specify codec json on the input.</p><pre class="crayon-plain-tag">input { stdin { codec =&gt; json } }

filter {
    if ![clicked] {
        mutate  {
            add_field =&gt; ["clicked", false]
        }
    }
}

output { stdout { codec =&gt; json }}</pre><p></p>
<h4> Use output stdout with codec =&gt; rubydebug<img class="alignright size-medium wp-image-3472" src="http://blog.comperiosearch.com/wp-content/uploads/2015/04/rubydebyg-300x106.png" alt="rubydebyg" width="300" height="106" /></h4>
<p>Using codec rubydebug prints out a pretty object on the console</p>
<h4>Use verbose or &#8211;debug command line flags</h4>
<p>If you want to see more details regarding what logstash is really doing, start it up using the &#8211;verbose  or &#8211;debug  flags. Be aware that this slows down processing speed greatly!</p>
<h4>Send logstash output to a log file.</h4>
<p>Using the -l “logfile.log” command line flag to logstash will store output to a file. Just watch your diskspace, in particular in combination with the &#8211;verbose flags these files can be humongous.</p>
<h4>When using file input: delete .sincedb files. in your $HOME directory</h4>
<p>The file input plugin stores information about how far logstash has come into processing the files in .sincedb files in the users $HOME directory. If you want to re-process your logs, you have to delete these files.</p>
<h4>Use the input generate stage</h4>
<p>You can add text lines you want to run through filters and output stages directly in the config file by using the generate input filter.</p><pre class="crayon-plain-tag">input {
  generator{
    lines =&gt; [
      '{"@message":"fisk"}',
      '{"@message": {"fisk":true}}',
      '{"notMessage": {"fisk":true}}',
      '{"@message": {"clicked":true}}'
      ]
    codec =&gt; "json"
    count =&gt; 5
  }
}</pre><p></p>
<h4>Use mutate add_tag after each successful stage.</h4>
<p>If you are developing configuration on a live system, adding tags after each stage makes it easy to search up  the log events in Kibana/Elasticsearch.</p><pre class="crayon-plain-tag">filter {
  mutate {
    add_tag =&gt; "before conditional"
  }
  if [@message][clicked] {
    mutate {
      add_tag =&gt; "already had it clicked here"
    }
  } else {
      mutate {
        add_field  =&gt; [ "[@message][clicked]", false]
    }
  }
  mutate {
    add_tag =&gt; "after conditional"
  }
}</pre><p></p>
<h4>Developing grok filters with the grok debugger app</h4>
<p>The grok filter comes with a range of prebuilt patterns, but you will find the need to develop your own pretty soon. That&#8217;s when you open your browser to <a title="https://grokdebug.herokuapp.com/" href="https://grokdebug.herokuapp.com/">https://grokdebug.herokuapp.com/</a> Paste in a representative line for your log, and you can start testing out matching patterns. There is also a discover mode that will try to figure out some fields for you.</p>
<p>The grok constructor, <a title="http://grokconstructor.appspot.com/do/construction" href="http://grokconstructor.appspot.com/do/construction">http://grokconstructor.appspot.com/do/construction</a>  offers an incremental mode, which I have found quite helpful to work with. You can paste in a selection of log lines, and it will offer a range of possibilities you can choose from, trying to match one field at a time.</p>
<h4> SISO</h4>
<p>If possible, pre-format logs so Logstash has less work to do. If you have the option to output logs as valid json, you don&#8217;t need grok filters since all the fields are already there.</p>
<p>&nbsp;</p>
<p>This has been a short runthrough of the tips and tricks we remember to have used. If you know any other nice ways to develop Logstash configurations, please comment below.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2015/04/10/how-to-develop-logstash-configuration-files/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Elastic{ON}15: Day two</title>
		<link>http://blog.comperiosearch.com/blog/2015/03/19/elasticon15-day-two/</link>
		<comments>http://blog.comperiosearch.com/blog/2015/03/19/elasticon15-day-two/#comments</comments>
		<pubDate>Thu, 19 Mar 2015 20:59:41 +0000</pubDate>
		<dc:creator><![CDATA[Christoffer Vig]]></dc:creator>
				<category><![CDATA[Elasticsearch]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[aggregations]]></category>
		<category><![CDATA[elastic]]></category>
		<category><![CDATA[Elasticon]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[goldman sachs]]></category>
		<category><![CDATA[lucene]]></category>
		<category><![CDATA[mars]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[nasa]]></category>
		<category><![CDATA[resiliency]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[shield]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=3411</guid>
		<description><![CDATA[March 11, 2015 Keynote Fighting the crowds to find a seat for the keynote at Day 2 at elastic{ON}15 we were blocked by a USB stick with the curious caption  Microsoft (heart) Linux. Things have certainly changed. Microsoft The keynote, led by Elastic SVP of sales Aaron Katz, included Pablo Castro of Microsoft who was [...]]]></description>
				<content:encoded><![CDATA[<h6>March 11, 2015</h6>
<h4>Keynote</h4>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2015/03/msheartlinux.jpg"><img class="alignright size-medium wp-image-3412" src="http://blog.comperiosearch.com/wp-content/uploads/2015/03/msheartlinux-300x118.jpg" alt="msheartlinux" width="300" height="118" /></a>Fighting the crowds to find a seat for the keynote at Day 2 at elastic{ON}15 we were blocked by a USB stick with the curious caption  Microsoft (heart) Linux. Things have certainly changed.</p>
<p><span id="more-3411"></span></p>
<h5>Microsoft</h5>
<p>The keynote, led by Elastic SVP of sales Aaron Katz, included Pablo Castro of Microsoft who was keen to explain how this probably isn’t so far from the truth. Elasticsearch is used  internally in several Microsoft products among Linux and other open source software and this is a huge change from the Microsoft we know from around five years ago. Pablo revealed some details towards how elasticsearch is used as data storage and search platform in MSN, Microsoft Dynamics and Azure Search. Microsoft truly has gone through some fundamental changes lately embracing open source both internally and externally. We see this as a demonstration of the power of open source and the huge value of Elastic(search) brings to  many organizations. As Jordan Sissel said in the keynote yesterday “If a user has a problem, it is a bug”. This is a philosophical stance towards a conception of software as an enabler of  creativity and growth, in contrast to viewing software as a fixed product packaged for sale.</p>
<h5>Goldman Sachs</h5>
<p>Microsofts contribution was in the middle part of the keynote. The first part was a discussion with Don Duet, managing director of Goldman Sachs. Goldman Sachs provides financial services on a global scale, and has been on the forefront of technology since its inception in 1869. They were an early adopter of Elasticsearch since it was as an easy to use search and analytics tool for big data. Goldman Sachs is now using elasticsearch extensively as a key part of their technological stack.</p>
<h5>NASA</h5>
<p>The most mind blowing part of the keynote was the last one held by two chaps from the Jet Propulsion Labs team at NASA, Ricky Ma and Don Isla. They first showed their awesome internal search with previews, and built in rank tuning. Then they talked about the Mars Curiosity rover, a robot planted on Mars which runs around taking samples and selfies. It constantly sends data back to earth where the JPL team analyzes the operations of the rover. Elasticsearch is naturally at the center of this interplanetary operation, nothing less.</p>
<div style="width: 352px" class="wp-caption alignright"><img src="http://i.imgur.com/UACwKNR.jpg" alt="It definitely takes better selfies than me" width="342" height="240" /><p class="wp-caption-text">Mars Curiosity Rover Selfie</p></div>
<p>The remainder of the day contained sessions across the same three tracks as the first day. In addition five tracks of birds of a feather or “lounge” sessions were held where people gathered in smaller groups to discuss various topics.  Needless to say the breadth of the program meant we were stretched thin. We chose to focus on three topics that are of particular importance to our customers: aggregations, security &amp; Shield, and resiliency</p>
<h4>More aggregations</h4>
<p>Adrien Grand &amp; Colin Goodheart-Smithe did a deep dive into the details of aggregations and how they are computed. In particular how to tune them and the results in terms of execution complexity. A key point is the approximations that are employed to compute some of the aggregations which involve certain trade offs in speed over accuracy. Aggregations are a very powerful feature requiring some some planning to be feasible and efficient.</p>
<h4><b>Security/Shield</b></h4>
<p>Uri Boness talked about Shield and the current state of authentication &amp; authorization, He provided some pointers to what is on the roadmap for the coming releases. Unfortunately, there does not appear to be any concrete plans for providing built in document level security. This is a sought after feature that would certainly make the product more interesting in many enterprise settings. Then again, there are companies who provide connector frameworks that include security solutions for elasticsearch. We had a chat with some of them at the conference, including Enonic, SearchBlox and Search Technologies.</p>
<h4><b>Facebook</b></h4>
<p>Peter Vulgaris from Facebook explained how they are using elasticsearch. To me, the story resembled Microsoft’s. Facebook has heaps of data, and lots of use cases for it. Once they started to use elasticsearch it was widely adopted in the company and the amount of data indexed grew ever larger which forced them to think more closely about how they manage their clusters.</p>
<p>&nbsp;</p>
<h4><b>Resiliency</b></h4>
<p>Elasticsearch is a distributed system, and as such shares the same potential issues as other distributed systems. Boaz Leskes &amp; Igor Motov explained the measures that have been undertaken in order to avoid problems such as “split-brain” syndrome. This is when a cluster is confused about what node should be considered the master. Data safety and security are important features of Elasticsearch and there is a continuous effort in place in these areas.</p>
<p>&nbsp;</p>
<h4><b>Lucene</b></h4>
<p>Stepping back to day 1 and the Lucene session featuring the mighty Robert Muir, we learned that Lucene version 5 includes a lot of improvements. Especially performance wise regarding compression both on indexing and query times which enables faster execution times and reduces resource consumption. There has also been made efforts to the Lucene core enabling a merging of query and filter as two sides of the same coin. After all a query is just  a filter with a relevance score. On another note Lucene will now handle caching of queries by itself.</p>
<h4><b>Wrapping it up</b></h4>
<p>Elastic{ON}15 stands as a confirmation of the attitude that were essential in the creation of the elasticsearch project. The visions that guided the early development are still valid today, except the scale is larger. The recent emphasis on stability, security and resiliency will welcome a new wave of users and developers.</p>
<p>At the same time there is a continuous exploration and development into big data related analytics but with the speed and agility we have come to expect from Elasticsearch.</p>
<p>Thanks for this year, looking forwards to next!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2015/03/19/elasticon15-day-two/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Elastic{ON}15: Day one</title>
		<link>http://blog.comperiosearch.com/blog/2015/03/11/elasticon15-day-one/</link>
		<comments>http://blog.comperiosearch.com/blog/2015/03/11/elasticon15-day-one/#comments</comments>
		<pubDate>Wed, 11 Mar 2015 16:07:48 +0000</pubDate>
		<dc:creator><![CDATA[Christoffer Vig]]></dc:creator>
				<category><![CDATA[Elasticsearch]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[aggregations]]></category>
		<category><![CDATA[Elasticon]]></category>
		<category><![CDATA[found]]></category>
		<category><![CDATA[Kibana]]></category>
		<category><![CDATA[logstash]]></category>
		<category><![CDATA[san francisco]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=3393</guid>
		<description><![CDATA[March 10, 2015 At Comperio we have been speculating for a while now that Elasticsearch might just drop search from their name. With Elasticsearch spearheading the expansion of search into analytics and all sorts of content and data driven applications such a change made sense to us. What the name would be we had no [...]]]></description>
				<content:encoded><![CDATA[<h6>March 10, 2015<br />
<a href="http://blog.comperiosearch.com/wp-content/uploads/2015/03/IMG_20150310_1112452cropped.jpg"><img class="alignright size-medium wp-image-3396" src="http://blog.comperiosearch.com/wp-content/uploads/2015/03/IMG_20150310_1112452cropped-300x140.jpg" alt="IMG_20150310_111245~2cropped" width="300" height="140" /></a></h6>
<p>At Comperio we have been speculating for a while now that Elasticsearch might just drop search from their name. With Elasticsearch spearheading the expansion of search into analytics and all sorts of content and data driven applications such a change made sense to us. What the name would be we had no idea about however &#8211; ElasticStash, KibanElastic StashElasticLog &#8211; none of these really rolled of the tongue like a proper brand.</p>
<p>More surprising is the Elasticsearch move into the cloud space by acquiring Found. A big and heartfelt congratulations to our Norwegian colleagues from us at Comperio. Found has built and delivered an innovative and solid product and we look forward to seeing them build something even better as a part of Elastic.</p>
<p>Elasticsearch is renamed to Elastic, and Found is no longer just Found, but Found by Elastic. The opening keynote held by CEO Steven Shuurman and Shay Banon was a tour of triumph through the history of Elastic, detailing how the company has grown sort of in an organic, natural manner, into what it is today. Kibana and Logstash started as separate projects but were soon integrated into Elastic. Shay and Steven explained how old roadmaps for the development of Elastic included plans to create CloudES, search as a cloud service. CloudES was never created, due to all the other pressing issues. Simultaneously, the Norwegian company Found made great strides with their cloud search offering, and an acquisition became a very natural fit.</p>
<p>Elastic{ON} is the first conference devoted entirely to the Elastic family of products. The sessions consist on one hand of presentations by developers and employees of Elastic, on the other there is “ELK in the wild” showcasing customer use cases, including Verizon, Github, Facebook and more.</p>
<p>On day one the sessions about core elasticsearch, Lucene, Kibana and Logstash were of particular interest to us.</p>
<h4><strong>Elasticsearch</strong></h4>
<p>The session about “Recent developments in elasticsearch 2.0” held by Clinton Gormley and Simon Wilnauer revealed a host of interesting new features in the upcoming 2.0 release. There is a very high focus on stability, and making sure that no releases should contain bugs. To illustrate this Clinton showed graphs relating the number of lines of code compared to lines of tests, where the latter was rising sharply in the latest releases. It was also interesting to note that the number of lines of code has been reduced recently due to refactoring and other improvements to the code base.</p>
<p>Among interesting new features are a new “reducer” step for aggregations allowing calculations to be done on top of aggregated results and a Changes API which helps managing changes to the index. The Changes API will be central in creating other features, for example update by query, where a typical use case involves logging search results, where the changes API will allow updating  information about click activity in the same log entry as the one containing the query.</p>
<p>There will also be a Reindex API that simplifies the development cycle when you have to refeed an entire index because you need to change a mapping or field type.</p>
<h4>Kibana</h4>
<p>Rashid Khan went through the motivations behind the development of Kibana 4, where support for aggregations, and making the product easier to work with and extendable really makes this into a fitting platform for creating tools for creating visualizations of data. Followed by “The Contributor&#8217;s Guide to the Kibana Galaxy” by Spencer Alger who demoed how to setup the development environment for Kibana 4 using using npm, grunt and bower- the web development standard toolset of today ( or was it yesterday?)</p>
<h4>Logstash</h4>
<p>Logstash creator Jordan Sissel presented the new features of Logstash 1.5, and what to expect in future versions. 1.5 introduces a new plugin system, and to great relief of all windows users out there the issues regarding file locking on rolling log files have been resolved! The roadmap also aims to vastly improve the reliability of Logstash, no more losing documents in planned or unplanned outages. In addition there are plans to add event persistence and various API management tools. As a consequence of the river technology being deprecated, Logstash will take the role as document processing framework that those of us who come from FAST ESP have missed for some time now. So in effect, all rivers, (including JDBC) will be ported to Logstash.</p>
<h4>Aggregations</h4>
<p>Mark Harwood presented a novel take on optimizing index creation for aggregations in the session “Building Entity Centric Indexes”. You may have tried to run some fancy aggregations,only to have elasticsearch dying from out of memory errors. Avoiding this often takes some insight into the architecture to<br />
structure your aggregations in the best possible manner. Mark essentially showed how to move some of the aggregation to indexing time rather than query time. The original use case was a customer who needed to know what is the average session length for the users of his website. Figuring that out involved running through the whole index, sorting by session id, picking the timestamp of the first item and subtracting from the second, a lot of operations with an enormous consumption of resources. Mark approaches the problems in a creative and mathematical manner, and it is always inspiring to attend his presentations. It will be interesting to see whether the Changes API mentioned above will deliver functionality that can be used to improve aggregated data.</p>
<h4>.NET</h4>
<p>Deep dive into the .NET clients with Martijn Laarman showed how to use a strongly typed language as C# with elasticsearch. Yes, it is actually possible, and it looked very good. There is a low-level client that just connects to the api where you have to to do all the parsing yourself, and a high-level client called NEST building on top of that offering a strongly typed query DSL having almost 1 to 1 mapping to the elasticsearch dsl. Particularly nifty was the covariant result handling, where you can specify the type of results you need back, considering a search result from elasticsearch can contain many types.</p>
<p>Looking forwards to day 2!<br />
<a href="http://blog.comperiosearch.com/wp-content/uploads/2015/03/IMG_20150310_213606.jpg"><img class="alignright size-medium wp-image-3391" src="http://blog.comperiosearch.com/wp-content/uploads/2015/03/IMG_20150310_213606-300x222.jpg" alt="IMG_20150310_213606" width="300" height="222" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2015/03/11/elasticon15-day-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kibana 4 &#8211; the beer analytics engine</title>
		<link>http://blog.comperiosearch.com/blog/2015/02/09/kibana-4-beer-analytics-engine/</link>
		<comments>http://blog.comperiosearch.com/blog/2015/02/09/kibana-4-beer-analytics-engine/#comments</comments>
		<pubDate>Mon, 09 Feb 2015 00:20:36 +0000</pubDate>
		<dc:creator><![CDATA[Christoffer Vig]]></dc:creator>
				<category><![CDATA[Elasticsearch]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=3226</guid>
		<description><![CDATA[Kibana 4 is a great tool for analyzing data. Vinmonopolet, the Norwegian government owned alcoholic beverage retail monopoly, makes their list of products available online in an easily digestible csv format. So, what beer should I buy next? Kibana will soon tell me. Kibana 4 is a data visualization and analytics tool for elasticsearch. Kibana [...]]]></description>
				<content:encoded><![CDATA[<p>Kibana 4 is a great tool for analyzing data. Vinmonopolet, the Norwegian government owned alcoholic beverage retail monopoly, makes their list of products available online in an <a href="http://www.vinmonopolet.no/artikkel/om-vinmonopolet/datadeling">easily digestible csv format</a>. So, what beer should I buy next? Kibana will soon tell me.</p>
<p><span id="more-3226"></span></p>
<p>Kibana 4 is a data visualization and analytics tool for elasticsearch. Kibana 4 was launched in February 2015, and builds on top of Kibana 3, incorporating user feedback and recent developments in elasticsearch, the most mind blowing being the support for aggregations. Aggregations are like facets/navigators/refiners on steroids, with a lot of advanced options for data drill-down. But no matter how easy a tool is to use, it only gets interesting once we have some questions that need to be answered. So what I want to know is:</p>
<h4>1. What beer gives the most value for money?</h4>
<h4>2. What is the most Belgian of Belgian beers?</h4>
<h4>3. Which of the most Belgian beers give the most value for money?</h4>
<p>The dataset from Vinmonopolet does not contain the important metric &#8220;price pr unit of alcohol&#8221;. So to begin with, we need to add that. It could have been done in Excel, or as part of preprocessing. Since this post isn&#8217;t about how to get data data indexed in elasticsearch we use a nice new feature of Kibana that lets you add calculated fields.</p>
<p>In the Settings -&gt; Indices section, there is an an option to create a Scripted Field.<br />
<a href="http://blog.comperiosearch.com/wp-content/uploads/2015/02/scriptedfield2.png"><img src="http://blog.comperiosearch.com/wp-content/uploads/2015/02/scriptedfield2.png" alt="scriptedfield2" width="426" height="309" class="alignright size-full wp-image-3352" /></a></p>
<p>The field for price pr.unit of alcohol is added as calculation in the scripted field, flooring the number to the nearest integer. Scripting is done using Lucene Expressions, after some vulnerabilites were discovered with using Groovy as scripting language (this changed from RC to the final release of Kibana).</p>
<h3>What beer gives the most value for money?</h3>
<p>Now we can create a nice little bar chart in Kibana. Using the minimum pricePrAlcohol as Y-axis, bottom terms Varenavn as X-axis.</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2015/02/minPriceBeers2.png"><img class="alignright size-full wp-image-3273" src="http://blog.comperiosearch.com/wp-content/uploads/2015/02/minPriceBeers2.png" alt="minPriceBeers" width="583" height="491" /></a></p>
<p>&nbsp;</p>
<p>The chart reveals that beer with the best alcohol/price ratio is <a href="http://www.sheltonbrothers.com/beers/mikkeller-arh-hvad/">Mikkeler Årh Hvad?!</a>, A very nice beer, I had it last week. Mikkeler is a Danish brewery, but they brew most of their beer in Belgium, so this is actually a Belgian beer.</p>
<h3>What is the most Belgian of Belgian beers?</h3>
<p>Next up I want to figure out what is the most Belgian of Belgian beers. Most of the products in Vinmonopolet&#8217;s catalogue have entries for &#8220;Smak&#8221;, or &#8220;Taste&#8221;. Let&#8217;s put the significant terms aggregation to work on &#8220;Smak&#8221; and see what falls out.</p>
<p><img class="alignright wp-image-3294 size-medium" src="http://blog.comperiosearch.com/wp-content/uploads/2015/02/beersigtermspie-293x300.png" alt="beersigtermspie" width="293" height="300" /><a href="http://blog.comperiosearch.com/wp-content/uploads/2015/02/beersigtermslegend.png"><img class="alignright wp-image-3293 size-full" src="http://blog.comperiosearch.com/wp-content/uploads/2015/02/beersigtermslegend.png" alt="beersigtermslegend" width="96" height="439" /></a></p>
<p>The pie chart shows countries in the inner circle, and significant terms in the outer circle. The largest pie belongs to Norwegian beers, as shown in the legend on the right. Using Kibana, you can also hover over the entries to highlight the selection in the pie chart, very nice feature especially for the colourly challenged population that are unable to match colors. Kibana allows drill down by clicking on pie slices, and you can see the data table and other details by clicking on the small arrow at the bottom.</p>
<p>The most significant terms for Belgian beers according to this query is &#8220;bread&#8221;, &#8220;yeast&#8221;, &#8220;malt&#8221; and &#8220;malty&#8221;. That&#8217;s hardly surprising since this is beer. We should expect something a little more specific. The significant terms aggregation returns terms that are more frequent in a foreground selection, compared to a background selection. In our case, we select product of type beer, from country Belgium, and the background is by default the contents of the entire index, or in other words, the complete product catalog from Vinmonopolet. This catalog contains a vast amount of wine, liquor and other irrelevant items. Since we are really only interested to see the significant terms of Belgian beers compared to other beers, we can add a custom parameter to select the background manually. Paste this into the JSON input of the advanced section.</p><pre class="crayon-plain-tag">{
    "background_filter": {
        "term": {
            "Varetype": "Øl"
        }
    }
}</pre><p>Using this filter, the significant terms for Belgian beers are &#8220;impact, plum, lemon, bread&#8221;.</p>
<p>&nbsp;</p>
<p>What beers actually match these descriptions? Some suggestions can be revealed through nesting an aggregation on product name, on top of the one we already have.</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2015/02/belgianbeersWithSigTerms.png"><img class="alignright size-full wp-image-3275" src="http://blog.comperiosearch.com/wp-content/uploads/2015/02/belgianbeersWithSigTerms.png" alt="belgianbeersWithSigTerms" width="827" height="487" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The non-colourly-challenged may easily see that Het Anker Lucifer matches both &#8220;anslag&#8221; (impact) and &#8220;sitrus&#8221; (lemon). Some beers match two terms, others match one, none match all four terms. Ideally, the most Belgian of Belgian beers should contain all the most significant terms. The significant terms are &#8220;impact,bread,lemon,plum&#8221; (&#8220;anslag,brødbakst,sitrus,plomme&#8221;).  Typing this as a Lucene query into the Discover tab on Kibana.</p><pre class="crayon-plain-tag">Land:Belgia AND Smak:sitrus,plomme,br&oslash;dbakst,anslag AND Varetype:&Oslash;l</pre><p>Returns &#8220;<span style="color: #444444;">Silly Green Killer IPA&#8221; at result number 1, having Smak:  &#8220;<strong>Fruktig <mark>anslag</mark> med <mark>sitrus</mark>, korn, humle og <mark>brødbakst</mark>. Lang, frisk avslutning.&#8221; </strong>Containing three of the terms; impact, lemon and bread. Since no beers contain all four terms, we can hereby pronounce a winner of most Belgian of all Belgian beers according to Vinomonpolet catalogoue (and a ridiculous significant terms trick): Silly Green Killer IPA! Congratulations! </span></p>
<h3>Which of the most Belgian beers give the most value for money?</h3>
<p>The previous investigation did not take economic considerations into account. Using the Line Chart, reusing the saved search from the previous query, adding the minimum pricePrAlcohol as Y-axis, and setting the X-axis to the terms aggregation for Varenavn (product name) bumping it up to 52 entries to make sure it contains all the results. The graph shows all beers containing at least one of our sought after terms. The Silly Green Killer IPA can be found at the upper quart of the table having a price pr alcohol unit at 27.51. Abbaye de Rocs Bruin comes in as a winner at the bottom edge of the scale, with a whooping 13.43 NOK pr alcohol unit, having a Smak field containing only the term &#8220;sitrus&#8221; (lemon).</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2015/02/belgianbeerPriceDist.png"><img class="aligncenter wp-image-3302 size-full" src="http://blog.comperiosearch.com/wp-content/uploads/2015/02/belgianbeerPriceDist-e1423440118217.png" alt="belgianbeerPriceDist" width="700" height="361" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>It would be nice to see what terms the beers contain, to enable a qualified judgement. Kibana allows to split up the display into several graphs. I will use this together with the filter aggregation to show one graph for each of the significant terms.</p>
<p>&nbsp;</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2015/02/belgianbeerswithsigtermsAndAlc.png"><img class="alignleft wp-image-3303" src="http://blog.comperiosearch.com/wp-content/uploads/2015/02/belgianbeerswithsigtermsAndAlc.png" alt="belgianbeerswithsigtermsAndAlc" width="701" height="405" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The graphs are, from top to bottom: sitrus (lemon), brødbakst (bread), anslag (impact), plomme (plum). The colors indicate alcohol content.</p>
<p>In this post, I have tried to show how you can use Kibana 4 and elasticsearch for data exploration and analysis. Please use the comment form below or contact me if you have any questions. If you enjoyed this article, why don&#8217;t you give me a <a href="https://untappd.com/user/Babadofar">toast on Untapped</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2015/02/09/kibana-4-beer-analytics-engine/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
