Skip to main content

Limit restful requests to backend ElasticSearch cluster: Queries only.

Project description

Limit restful requests to backend ElasticSearch cluster: Queries only.

Requirements

  • Python 2.7

  • An ElasticSearch cluster to forward queries to

Install

I will assume you have Python installed (if not, here are Windows7 instructions)

pip install esFrontLine

Setup

You must write your own setting.json file with the following properties set:

  • elasticsearch - (Array of) ElasticSearch nodes

  • elasticsearch.host - URL of the ElasticSearch node that will accept query requests

  • elasticsearch.port - port for ES (default = 9200)

  • flask - flask.run() parameters (default port = 5000)

  • debug - turn on debugging

  • whitelist - list of indexes that are allowed

Here is an example of my settings.json file

{
    "elasticsearch":[{
        "host":"http://elasticsearch4.metrics.scl3.mozilla.com",
        "port":9200
    },{
        "host":"http://elasticsearch5.metrics.scl3.mozilla.com",
        "port":9200
    },{
        "host":"http://elasticsearch7.metrics.scl3.mozilla.com",
        "port":9200
    },{
        "host":"http://elasticsearch8.metrics.scl3.mozilla.com",
        "port":9200
    }],
    "flask":{
        "host":"0.0.0.0",
        "port":9292,
        "debug":false,
        "threaded":true,
        "processes":1
    },
    "whitelist":["bugs", "org_chart", "bug_summary", "reviews"],
    "debug":{
        "log":[{
            "filename": "./tests/results/logs/app.log",
            "maxBytes": 10000000,
            "backupCount": 200,
            "encoding": "utf8"
        },{
            "stream":"sys.stdout"
        }]
    }

}

Execution

python app.py --settings-file <path_to_file_with_JSON_settings>

Code Source

https://github.com/klahnakoski/esFrontLine

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

esFrontLine-1.1.14230.zip (9.2 kB view hashes)

Uploaded Source

Built Distributions

esFrontLine-1.1.14230.win32-py2.7.exe (241.8 kB view hashes)

Uploaded Source

esFrontLine-1.1.14230-py2.7.egg (9.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page