草庐IT

ElasticSearch(九):ELK 架构

全部标签

docker - 无法在 Raspberry Pi 上运行 elasticsearch 镜像

尝试在我的树莓派上运行elasticsearch图像时出现错误。它在我的Mac上运行良好,所以它可能是特定于操作系统的。我可以运行其他图像。pi@raspberrypi:~/folder/folder$dockerrunnode:latestpi@raspberrypi:~/folder/folder$dockerrundocker.elastic.co/elasticsearch/elasticsearch:5.6.3standard_init_linux.go:195:execuserprocesscaused"execformaterror"广泛搜索了standard_init_

elasticsearch - 将 Elasticsearch DSL 翻译成 gopkg.in/olivere/elastic.v5

我有json,我想使用https://godoc.org/gopkg.in/olivere/elastic.v5将其转换为Elasticsearch查询JSON={"query":{"bool":{"filter":[{"exists":{"field":"Videos.en"}}]}}}很简单!到目前为止我所得到的——这显然是行不通的——是:enVidsQuery,err:=elastic.NewBoolQuery().Filter(elastic.Exists("field","Videos.en"))elastic在我的导入中引用了“gopkg.in/olivere/elasti

elasticsearch - GoLang 从 Elasticsearch 结果中解码 JSON

我有从Elasticsearch返回的数据,使用“github.com/olivere/elastic”。那种工作,当我将它添加到我的结构并将其串起来时,就像这样,data:=Api{Total:myTotal,Data:string(result),}c.JSON(http.StatusOK,totalData)api是这样的结构,typeApistruct{Totalinterface{}Datainterface{}}这将返回数据正常,从1到请求的任意数量的结果。加载到数据接口(interface)的结果如何不转义什么的,例如"Data":"{\"CID\":\"XXXXXXXX

elasticsearch - 更新整个选定的弹性记录

使用olivere/elastic将我的Go(1.10)连接到在Docker容器中运行的Elastic搜索。现在,当数据库有更新时,它将对我的API运行一个触发器,它应该在我的Elastic搜索中搜索该记录,如果没有找到则添加一条新记录,或者如果找到则更新整个记录。现在我有了添加新记录的代码并且可以正常工作,但是我看不到如何更新整个记录,我可以更新该记录的选定元素,但不能更新整个记录。这是我的:testData:=[]byte(`{"data1":"22222","data2":"ddddd"}`)script:=elastic.NewScript("ctx._source=param

Google Directory API 添加自定义架构/根据 google API 将其更新给用户(在进行中)

我正在尝试将CustomSchema上传到GSuite中一家公司的所有用户。此自定义架构包含他们的Github用户名,我使用githubAPI将其提取。问题是,运行代码后,并没有添加Gsuite中的账号。相关代码(已建立使用管理员身份验证的GSuite连接,map包含所有用户条目。如果您还需要更多代码,我可以为您提供-只是尽量保持简单):for_,u:=rangeallUsers.Users{ifu.CustomSchemas!=nil{log.Printf("%v",string(u.CustomSchemas["User_Names"]))}else{u.CustomSchemas

elasticsearch - 从 Elasticsearch 中同步删除文档

我正在使用olivere/elastic在Go中使用elasticsearch。这是我的代码://(1)deletedocument_,err:=e.client.Delete().Index(index).Type("entity").Id(id).Do(e.ctx)iferr!=nil{fmt.Println(err.Error())}//(2)getalldocumentsresult,err:=e.client.Search().Index(index).From(1).Size(100).Do(e.ctx)iferr!=nil{log.Println(err)}fmt.Pri

新项目的 Golang 架构问题

我正在使用这个https://medium.com/@eminetto/clean-architecture-using-golang-b63587aa5e3f我下一个项目的架构。但是我有几个问题:缓存应该放在哪一层?认证/授权应该在哪一层?这是与Go一起使用的良好架构吗? 最佳答案 您想缓存什么,数据库查询或文件或请求?认证/授权可以在中间件层也可以在View/模型层之前。您可以根据您的需要和目标挑选您的架构。选择架构没有硬性规定。正确的架构来自于为同一目标在不同架构上尝试POC。 关

elasticsearch - {"error":"Content-Type header [] is not supported","status":406} When Inserting Data to Elasticsearch with Golang

有谁知道如何解决这个错误?我用Golang向elasticsearch中插入数据,但是好像因为这个错误没有插入数据。{"error":"Content-Typeheader[]isnotsupported","status":406}我已经设置了内容类型。注意我用的是elasticsearch6.4.3request,err:=http.NewRequest("POST",urlSearch,bytes.NewBuffer(query))request.Close=truerequest.Header.Set("Content-Type","application/json")最后但同

elasticsearch - 如何在 Elastigo 中设置 Content-Type header

我在尝试使用elastigo将数据插入elasticsearch时收到此错误。错误是{"error":"Content-Typeheader[]isnotsupported","status":406}有谁知道如何将内容类型header设置为elastigo?我认为Elastigo不适用于elasticsearch6.4.3,我是否应该更改为olivere包来向elasticsearch发出请求? 最佳答案 shouldIchangetooliverepackagetomakerequeststoelasticsearch?是的

elasticsearch - 如何检索 elasticsearch golang 客户端中搜索命中的整个来源?

我有一个包含太多字段的索引,比如一个文档有6个字段,另一个有不同数量的字段,总共有近千个不同的字段。我关注了这个https://github.com/olivere/elastic/wiki/Search,它工作正常,但我无法创建所有字段的结构并对其执行json.Unmarshal(*hit.Source,&t)。有什么方法可以在没有字段结构的情况下检索整个源。我使用elasticsearch版本-7和olivreelasticsearchgolang库。 最佳答案 如果我理解正确,您不想解码json结果-您只想访问该值。搜索操作返