Git Product home page Git Product logo

elk-index-size-tests's Introduction

#elk-index-size-tests

Supporting files for testing Elasticsearch index sizes. You can find more details on this blog post: https://www.elastic.co/blog/elasticsearch-storage-the-true-story.

##Testing steps

  • Ingest the log file using Logstash with a simple config

      # Uncompress logs.gz and logs2.gz
      gzip -d logs.gz logs2.gz
      # Symlink index_template.json to index_template_n.json where n is current iteration of test
      ln -sf index_template_n.json index_template.json
      # For ingesting mostly structured log file:
      bin/logstash -f complete.conf < logs
      # For ingesting semi-structured log file containing more text:
      bin/logstash -f complete2.conf < logs2
      # For ingesting mostly structured log file, retaining original event:
      bin/logstash -f complete3.conf < logs
      # For ingesting semi-structured log file containing more text, retaining original event:
      bin/logstash -f complete4.conf < logs2
    
  • Optimize the index to 1 segment (for a consistently comparable size) by calling POST elk_workshop/_optimize?max_num_segments=1

      curl -XPOST 'http://localhost:9200/elk_workshop/_optimize?max_num_segments=1'
    
  • Get the index size on disk by calling GET elk_workshop/_stats

      curl -XGET 'http://localhost:9200/elk_workshop/_stats?pretty=true&filter_path=indices.elk_workshop.primaries.store.size_in_bytes'
    
  • Remove the index by calling DELETE elk_workshop

      curl -XDELETE 'http://localhost:9200/elk_workshop'
    

##Config file descriptions

###Logstash configs

File Description
complete.conf Removes the original message
complete2.conf Adds a randomized unstructured text element to end of log line
complete3.conf Retains the original message
complete4.conf Adds a randomized unstructured text element to end of log line, retains the original message

###Elasticsearch index templates

File Description
index_template_1.json All string fields are indexed in both analyzed and not_analyzed form; _all is enabled
index_template_2.json All string fields are indexed in both analyzed and not_analyzed form; _all is disabled
index_template_3.json All string fields are indexed in not_analyzed form; _all is disabled
index_template_3b.json All string fields are indexed in not_analyzed form except for message field which is analyzed; _all is disabled
index_template_4.json All string fields are indexed in not_analyzed form except for agent field which is analyzed; _all is disabled

#Acknowledgements

Thanks to my colleague Christian Dahlqvist (@cdahlqvist) for adding single-shard tests and semi-structured test logs.

elk-index-size-tests's People

Contributors

peterskim12 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.