update: conn to es add 5s timeout
This commit is contained in:
parent
77f0bbebe2
commit
887f450cf8
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -40,7 +40,7 @@ jobs:
|
||||
run: CGO_ENABLE=0 GOOS=darwin GOARCH=arm64 go build -ldflags='-s -w' -o dist/esgo2dump_${{ github.ref_name }}_darwin_arm64 .
|
||||
|
||||
- name: create releases
|
||||
id: create_release
|
||||
id: create_releases
|
||||
uses: "marvinpinto/action-automatic-releases@latest"
|
||||
with:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
@ -13,6 +13,7 @@ import (
|
||||
"github.com/elastic/go-elasticsearch/v7/esapi"
|
||||
"github.com/elastic/go-elasticsearch/v7/esutil"
|
||||
"github.com/sirupsen/logrus"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
@ -55,6 +56,7 @@ func NewClient(url *url.URL, iot interfaces.IO, qm map[string]any) (interfaces.D
|
||||
RetryBackoff: nil,
|
||||
Transport: &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
DialContext: (&net.Dialer{Timeout: 5 * time.Second}).DialContext,
|
||||
},
|
||||
},
|
||||
); err != nil {
|
||||
|
32
readme.md
32
readme.md
@ -15,24 +15,28 @@
|
||||
|
||||
- download pre-build release:
|
||||
|
||||
[release](https://github.com/loveuer/esgo2dump/releases)
|
||||
[releases](https://github.com/loveuer/esgo2dump/releases)
|
||||
|
||||
### usage
|
||||
|
||||
`esgo2dump -h`
|
||||
|
||||
```bash
|
||||
esgo2dump --input=http://127.0.0.1:9200/some_index --output=./data.json
|
||||
|
||||
esgo2dump --input=http://127.0.0.1:9200/some_index --output=http://192.168.1.1:9200/some_index --limit=5000
|
||||
|
||||
esgo2dump --input=https://username:password@127.0.0.1:9200/some_index --output=./data.json
|
||||
|
||||
esgo2dump --input=http://127.0.0.1:9200/some_index --output=./data.json --query='{"match": {"name": "some_name"}}'`,
|
||||
```
|
||||
|
||||
### roadmap
|
||||
|
||||
[*] data dump
|
||||
|
||||
[*] mapping dump
|
||||
|
||||
[*] es to file
|
||||
|
||||
[*] es to es
|
||||
|
||||
[*] auto create index with mapping
|
||||
|
||||
[ ] auto create index with mapping,setting
|
||||
|
||||
[ ] support es8
|
||||
- [x] data dump
|
||||
- [x] mapping dump
|
||||
- [x] es to file
|
||||
- [x] es to es
|
||||
- [x] auto create index with mapping
|
||||
- [ ] auto create index with mapping,setting
|
||||
- [ ] support es8
|
Loading…
x
Reference in New Issue
Block a user