Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feature to specify ES pipeline for a given spreadsheet #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 26, 2019

Conversation

octavioranieri
Copy link
Contributor

From #83
Implemented and tested, both web interface and CLI.

How to use it:

1-Create a ingest pipeline in your Elasticsearch:
Using Kibana:

PUT /_ingest/pipeline/pipeline-client-geolocation
{
  "processors": [
    {
      "uppercase": {
        "field": "country"
      }
    },
    {
      "geoip": {
        "field": "client_ip"
      }
    }
  ]
}

or cURL:

curl -XPUT "http://elasticsearch:9200/_ingest/pipeline/pipeline-client-geolocation" -H 'Content-Type: application/json' -d'{  "processors": [    {      "uppercase": {        "field": "country"      }    },    {      "geoip": {        "field": "client_ip"      }    }  ]}'

2- Specify pipeline name using web interface:
webinterface

Or using CLI:

java -jar ./excelastic-1.3.7.jar ./sample.xlsx clients --pipeline pipeline-client-geolocation

Sample with dummy data: sample.xlsx

3-Results of GET clients/_search:

{
  "took" : 0,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 2,
      "relation" : "eq"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "clients",
        "_type" : "default",
        "_id" : "FSK5pG4BQ_0-LmAn-QXS",
        "_score" : 1.0,
        "_source" : {
          "country" : "BRAZIL",
          "geoip" : {
            "continent_name" : "North America",
            "country_iso_code" : "US",
            "location" : {
              "lon" : -97.822,
              "lat" : 37.751
            }
          },
          "client_ip" : "8.8.8.8"
        }
      },
      {
        "_index" : "clients",
        "_type" : "default",
        "_id" : "FiK5pG4BQ_0-LmAn-QXS",
        "_score" : 1.0,
        "_source" : {
          "country" : "CANADA",
          "geoip" : {
            "continent_name" : "Oceania",
            "country_iso_code" : "AU",
            "location" : {
              "lon" : 143.2104,
              "lat" : -33.494
            }
          },
          "client_ip" : "1.1.1.1"
        }
      }
    ]
  }
}

If no pipeline is specified, import will proceed normally.

@octavioranieri octavioranieri mentioned this pull request Nov 25, 2019
@codingchili codingchili merged commit 1cbf8f9 into codingchili:master Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants