Giter VIP home page Giter VIP logo

es-foxes's Introduction

ES-Foxes

Latest Version PRs Welcome

                                                   -:-` 
                                                  +mNNdo. 
                                         `       -NNNmNNm+`   
                                       `yhhys+:.`yNNmshNNNy` 
                                       /NNNNNNNmhNNNhssyNNNh.  
                                       :NNNyyhdmNNNNmmmNNNNNdyo/.``           
                                       `NNNhssssyhmNNNmddddmmNNNNdhyssssyyo-  
                                        yNNmsssssssyyssssssssyhdmmNNNNNNNNNN: 
                                        `mNNdssssssssssssssssssssssyhhdNNNNNy 
                                         -mNNmssssssssssssssyyhddmmNNNNNNNNNs 
                                          hNNmssssssssyhdmNNNNNNNNdhs++odNNm. 
                                         -NNNyssssydmNNNNNdhs+/-.``:ohNNNNs.  
                                         +NNNsssymNNNds+-``    `/ymNNNds/`    
                                         +NNNssdNNNs-`       .omNNNm+-`       
                                         :NNNymNNd-        `omNNmNNm/         
                                          dNNmNNm-        `yNNmhshNNNy-       
                                          -mNNNNd         oNNNysssymNNmy:`    
                                           /mNNNd        `mNNhssssssydNNNd+.  
                                            :mNNN:       `NNNyssssssssydmNNms:` 
                                             -dNNd-...`` `dNNdssssssssssshmNNNh:` 
                                         `.:osdNNNmmmdddysdNNNhssssssssssssydNNNh- 
                                      `-ohmNNNmddNNNmmmmNNNNNNNdsssssssssssssydNNm+ 
                                    `/hNNNds/-.``hNNmssssyhdmNNNmhssssssssssssshNNNo  
                                   /dNNms-       -NNNysssssssydNNNmhssssssssssssyNNN/ 
                                 .yNNmo`          hNNdsssssssssshNNNNhsssssssssssdNNm 
                                -mNNh.            yNNmsssssssssssshNNNmhsssssssssyNNN.
                               :NNNs              dNNdssssssssssssssdNNNhsssssssssNNN:
                              .mNNs              :NNNysssssssssssssssyhhsssssssssyNNN`
                             `dNNy              `dNNdssssssssssssssssssssssssssssmNNy 
                             oNNm.             `hNNmssssssssssssssssssssssssssssdNNm. 
                            `mNN+ `.-:/osyyhdddmNNNmdhyyssssssssssssssssssssssymNNd-  
                            +NNNsydmmNNNNmmdddddddmNNNNNmmdhyysssssssssssssyhmNNNs. 
                            hNNNNNdhs+/--..```````..-/oyhmNNNNmmddhhhhhhdmmNNNds-   
                            sddy/-`                     `.-/shdmmNNNNNNNNmdho:.       
                             .`                               `.--:://::-.`      

                                ▄▄▄▄▄▄▄▄         
                                ██▀▀▀▀▀▀                                         
                                ██         ▄████▄   ▀██  ██▀   ▄████▄   ▄▄█████▄ 
                                ███████   ██▀  ▀██    ████    ██▄▄▄▄██  ██▄▄▄▄ ▀ 
                                ██        ██    ██    ▄██▄    ██▀▀▀▀▀▀   ▀▀▀▀██▄ 
                                ██        ▀██▄▄██▀   ▄█▀▀█▄   ▀██▄▄▄▄█  █▄▄▄▄▄██ 
                                ▀▀          ▀▀▀▀    ▀▀▀  ▀▀▀    ▀▀▀▀▀    ▀▀▀▀▀▀  

This is a Golang script to backup, restore and transfer data between ElasticSearch clusters.

Installation

Requires Golang 1.12.1 or later

Please create .env file from .env.example and fill in all keys, do the same for foxes.yaml file which should be created similar to foxes.yaml.example

Sample

All backed up data are stored in the backup folder in TXT file format, the first line contains the name of the ElasticSearch index and the other lines following the data of that index. Each line of the backup is in json format containing the event id and its source.

First it is necessary to build the project

go build ./ 

After that it is possible to execute the commands:

Backup

./es-foxes backup index_name [url, default ELASTIC_URL]

examples:

./es-foxes backup event-2021-01-01
./es-foxes backup event-2021-01-01 http://127.0.0.1:9200

Restore

./es-foxes restore file_name [index_to, default first line of file] [url, default ELASTIC_URL]

example:

./es-foxes restore event-2021-01-01.txt event-2021-01-02 http://127.0.0.1:9200 

Copy

./es-foxes restore url_from index_from url_to [index_to, default first line of file]

example:

./es-foxes copy http://127.0.0.1:9200 event-2021-01-01 http://127.0.0.1:9400 event-2021-01-02

Clear

You must have the foxes.yaml file configured

example:

./es-foxes clear

Development

Want to contribute? Great!

The project using a simple code. Make a change in your file and be careful with your updates! Any new code will only be accepted with all viladations.

Kiwfy - Open your code, open your mind!

es-foxes's People

Contributors

dayknightmare 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.