Skip to content

shadow000fire/elasticsearch-river-csv

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSV River Plugin for ElasticSearch

The CSV River plugin allows you to index CSV files, or more accurately columized files delimiter by any single character.

You should only use one of csv_string, csv_data, csv_uri, csv_file. The first one found in that order will be used.

In order to install the plugin, simply run: bin/plugin -install xxBedy/elasticsearch-river-csv/1.0.1. If it doesn't work, clone git repository and build plugin manually.

-------------------------------------
| CSV Plugin | ElasticSearch        |
-------------------------------------
| master         | 0.19.x -> master |
-------------------------------------
| 1.0.1          | 0.19.x           |
-------------------------------------
| 1.0.0          | 0.19.x           |
-------------------------------------

The CSV river import data from CSV files and index it.

Creating the CSV river can be done using:

curl -XPUT localhost:9200/_river/my_csv_river/_meta -d '
{
    "type" : "csv",
    "poll":"5m",
    "fields" : [
        "column1",
        "column2",
        "column3",
        "column4"
    ],
    "field_separator" : ",",
    "escape_character" : ";",
    "quote_character" : "'",
    "csv_string":"1,second,third column",
    "csv_data":"bXksY3N2LGZpbGU=",
    "csv_uri":"http://pic.dhe.ibm.com/infocenter/tivihelp/v41r1/topic/com.ibm.ismsaas.doc/reference/LocationsImportSample.csv",
    "csv_file" : {
        "folder" : "/tmp",
        "filename_pattern" : ".*\\.csv$"	        
    },
    "index" : {
        "index" : "my_csv_data",
        "type" : "csv_row",
        "bulk_size" : 10000,
        "bulk_threshold" : 50
    }
}'

Optional parameters:
----------------------------------------
| Name              | Default value    |
----------------------------------------
| field_separator   | ,                |
----------------------------------------
| escape_character  | \                |
----------------------------------------
| quote_character   | "                |
----------------------------------------
| bulk_size         | 100              |
----------------------------------------
| bulk_threshold    | 10               |
----------------------------------------

License

This software is licensed under the Apache 2 license, quoted below.

Copyright 2012-2013 Martin Bednar

Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.

About

CSV river for ElasticSearch

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%