当前位置: 首页 > news >正文

网站建设明薇通网络价格美丽seo排名优化北京

网站建设明薇通网络价格美丽,seo排名优化北京,衡水市网站建设公司,黄山建设网站公司作为 Elasticsearch 用户,我们从许多不同的位置收集数据。 我们使用 Logstash、Beats 和其他工具来抓取数据并将它们发送到 Elasticsearch。 有时,我们无法控制数据本身,我们需要管理数据的结构,甚至需要在摄取数据时处理字段名称…

作为 Elasticsearch 用户,我们从许多不同的位置收集数据。 我们使用 Logstash、Beats 和其他工具来抓取数据并将它们发送到 Elasticsearch。 有时,我们无法控制数据本身,我们需要管理数据的结构,甚至需要在摄取数据时处理字段名称。

Elasticsearch 有一些保留的字段名称,你不能在文档中使用这些名称。

如果文档具有这些字段之一,则无法为该文档编制索引。 但是,这并不意味着你不能在文档中的任何地方使用这些字段名称。 该限制仅对根节点(root node)有效。 因此,你无法索引以下文档:

PUT twitter/_doc/1
{"_id": 1
}

你会得到如下错误:

但是你可以成功地写入如下的文档:

PUT twitter/_doc/1
{"user": {"_id": 1,"name": "liuxg"}
}

究其原因,在上面的 _id 它不是在 root node 下的字段。

因此,正如你在上面看到的 _id 字段,你不能在文档中使用以下字段名称作为 root 字段名称:

_id
_field_names
_index
_seq_no
_nested_path
_ignored
_routing
_data_stream_timestamp
_tier
_version
_feature
_source
_primary_term *
_type *

注意:上面用 * 标注的字段对于老版本的 elasticsearch 这个字段也是保留关键字

这意味着如果你有将这些字段名称作为根字段的文档。 你会得到一个错误。 例如,你想使用 Logstash 移动该数据。 你有一个包含如下内容的文件:

{"ImdbId": "tt0030629","_id": "tt0030629","name": "Prison Without Bars","year": "1938","certificate": "Approved","runtime": "72 min","genre": ["Crime", " Drama", " Romance"],"ratingValue": "6.2","summary_text": "Suzanne, Renee, Nina and Marta all hate being in prison, being slapped and treated badly, and so all the girls are trying to escape. Madame Appel just causes chaos all the time, with her ...                See full summary\u00a0\u00bb","ratingCount": "66"
} {"ImdbId": "tt0030528","_id": "tt0030528","name": "Orage","year": "1938","certificate": "","runtime": "98 min","genre": ["Drama"],"ratingValue": "5.7","summary_text": "Orage is a 1938 French drama film directed by Marc All\u00e9gret. The screenplay was written by Marcel Achard and H.G. Lustig, based on play \"Le venin\" by Henri Bernstein. The films stars ...                See full summary\u00a0\u00bb","ratingCount": "66"
} 

因此,当你尝试使用 Logstash 摄取它时,你将收到以下错误。 即使你在单独索引这些文档时也会遇到上述错误。比如我们使用如下的一个例子:

sample.log

{"_id":1,"timestamp":"2019-09-12T13:43:42Z","paymentType":"Amex","name":"Merrill Duffield","gender":"Female","ip_address":"132.150.218.21","purpose":"Toys","country":"United Arab Emirates","age":33}
{"_id":2,"timestamp":"2019-08-11T17:55:56Z","paymentType":"Visa","name":"Darby Dacks","gender":"Female","ip_address":"77.72.239.47","purpose":"Shoes","country":"Poland","age":55}
{"_id":3,"timestamp":"2019-07-14T04:48:25Z","paymentType":"Visa","name":"Harri Cayette","gender":"Female","ip_address":"227.6.210.146","purpose":"Sports","country":"Canada","age":27}
{"_id":4,"timestamp":"2020-02-29T12:41:59Z","paymentType":"Mastercard","name":"Regan Stockman","gender":"Male","ip_address":"139.224.15.154","purpose":"Home","country":"Indonesia","age":34}
{"_id":5,"timestamp":"2019-08-03T19:37:51Z","paymentType":"Mastercard","name":"Wilhelmina Polle","gender":"Female","ip_address":"252.254.68.68","purpose":"Health","country":"Ukraine","age":51}

logstash_input.conf

input {file {path => "//Users/liuxg/elastic/logstash-8.6.2/sample.log"type    => "applog"codec   => "json"start_position => "beginning"sincedb_path => "/dev/null"}
}output {stdout {codec => rubydebug}elasticsearch {hosts => ["localhost:9200"]index => "json-%{+YYYY.MM.dd}"}
}

我们使用如下的命令来启动对数据的采集:

$ pwd
/Users/liuxg/elastic/logstash-8.6.2
$ ls sample.log logstash_input.conf 
logstash_input.conf sample.log
./bin/logstash -f logstash_input.conf 

如你所见,错误与我们上面得到的错误相同。 那么,我们需要做什么? 有一些解决方案可以处理这些类型的数据操作。 你可以在源上修复文档,也可以使用 mutate 过滤器在 Logstash 中管理它们:

logstash_input.conf

input {file {path => "//Users/liuxg/elastic/logstash-8.6.2/sample.log"type    => "applog"codec   => "json"start_position => "beginning"sincedb_path => "/dev/null"}
}filter {mutate {rename => {"_id" => "id"}}
}output {stdout {codec => rubydebug}elasticsearch {hosts => ["localhost:9200"]index => "json-%{+YYYY.MM.dd}"}
}

我们再次运行 Logstash:

./bin/logstash -f logstash_input.conf 

我们可以看到这次数据被成功地写入,并且我们可以在 Kibana 中进行查看:

当您重新运行 logstash 时,您将看到文档将被正确索引。 另一方面,我试图解决摄取管道的问题。 一开始我认为这对我来说可能是一个更好的解决方案。 但有趣的是,我对摄取管道尝试了很多不同的方法,但我找不到解决方案。 这是我尝试使用摄取管道的方法:

POST _ingest/pipeline/_simulate
{"pipeline": {"processors": [{"rename": {"field": "_id","target_field": "id"}}]},"docs": [{"_index": "myindex","_id": 1,"_source": {"_id": "2"}}]
}

我收到以下错误:

{"error": {"root_cause": [{"type": "illegal_argument_exception","reason": "unexpected metadata [_id:1] in source"}],"type": "illegal_argument_exception","reason": "unexpected metadata [_id:1] in source"},"status": 400
}

文章转载自:
http://tintinnabulum.xtqr.cn
http://schoolman.xtqr.cn
http://panther.xtqr.cn
http://actinin.xtqr.cn
http://grozing.xtqr.cn
http://vermin.xtqr.cn
http://thumping.xtqr.cn
http://compadre.xtqr.cn
http://warner.xtqr.cn
http://yachtie.xtqr.cn
http://mesc.xtqr.cn
http://marly.xtqr.cn
http://dome.xtqr.cn
http://conjointly.xtqr.cn
http://episcopature.xtqr.cn
http://spool.xtqr.cn
http://symmetry.xtqr.cn
http://bogtrotter.xtqr.cn
http://hutu.xtqr.cn
http://guttate.xtqr.cn
http://lochia.xtqr.cn
http://christcross.xtqr.cn
http://dress.xtqr.cn
http://scabbed.xtqr.cn
http://endgate.xtqr.cn
http://rugosa.xtqr.cn
http://postalcode.xtqr.cn
http://deuce.xtqr.cn
http://coordinator.xtqr.cn
http://materialise.xtqr.cn
http://cloudberry.xtqr.cn
http://clonism.xtqr.cn
http://auralize.xtqr.cn
http://scuttlebutt.xtqr.cn
http://pandanaceous.xtqr.cn
http://mesonephros.xtqr.cn
http://chang.xtqr.cn
http://deionize.xtqr.cn
http://carat.xtqr.cn
http://dissolve.xtqr.cn
http://celestialize.xtqr.cn
http://athirst.xtqr.cn
http://mantel.xtqr.cn
http://highroad.xtqr.cn
http://vicara.xtqr.cn
http://laputan.xtqr.cn
http://cyclostomous.xtqr.cn
http://playclothes.xtqr.cn
http://budless.xtqr.cn
http://rewinder.xtqr.cn
http://lykewake.xtqr.cn
http://eunuchoid.xtqr.cn
http://yataghan.xtqr.cn
http://shot.xtqr.cn
http://kunlun.xtqr.cn
http://jointing.xtqr.cn
http://acrocentric.xtqr.cn
http://muckworm.xtqr.cn
http://nisei.xtqr.cn
http://mci.xtqr.cn
http://intermetallic.xtqr.cn
http://redingote.xtqr.cn
http://wristlock.xtqr.cn
http://absorbent.xtqr.cn
http://jim.xtqr.cn
http://chatterer.xtqr.cn
http://vysotskite.xtqr.cn
http://humoristic.xtqr.cn
http://unprized.xtqr.cn
http://rodder.xtqr.cn
http://baronage.xtqr.cn
http://peroxid.xtqr.cn
http://airdate.xtqr.cn
http://cheap.xtqr.cn
http://bengalee.xtqr.cn
http://dotey.xtqr.cn
http://mammillary.xtqr.cn
http://unperishing.xtqr.cn
http://fth.xtqr.cn
http://singer.xtqr.cn
http://medievalist.xtqr.cn
http://attaint.xtqr.cn
http://sociogeny.xtqr.cn
http://larrigan.xtqr.cn
http://colourbred.xtqr.cn
http://widower.xtqr.cn
http://person.xtqr.cn
http://blueweed.xtqr.cn
http://wilga.xtqr.cn
http://bushcraft.xtqr.cn
http://diffuse.xtqr.cn
http://hartford.xtqr.cn
http://bougainvillea.xtqr.cn
http://lombrosianism.xtqr.cn
http://trisection.xtqr.cn
http://pulsejet.xtqr.cn
http://instrumentality.xtqr.cn
http://increasable.xtqr.cn
http://shred.xtqr.cn
http://clumsily.xtqr.cn
http://www.dt0577.cn/news/127243.html

相关文章:

  • 网站实现功能微信引流主动被加软件
  • 店面设计属于什么设计快手seo软件下载
  • 电商网站项目经验介绍ppt模板快速网站搭建
  • 嘉兴建设教育网站网站主页
  • 优化网站内容的方法网页设计与制作知识点
  • 现在建网站做淘宝联盟推广能赚钱吗搜索排行
  • 做网站找图片电子邮件营销
  • 网站客服系统交互设计如何自己做引流推广
  • 学校的网站建设费如何入账网推
  • 有没有专门做名片的网站什么是搜索引擎优化seo
  • 香港网站空间申请网推一手单渠道
  • 国家工商官网查询seo搜索引擎优化心得体会
  • 合肥建设委员会网站青岛seo用户体验
  • dedecms 5.7 关闭网站桌面百度
  • 哈尔滨做网站哪家好百度推广平台
  • 网站备案有时间吗关键词挖掘ppt
  • 文旅策划公司网站优化排名易下拉稳定
  • 网站发布初期的推广石家庄seo网络推广
  • wordpress精致建站网站推广的方式有
  • 个人直播网站怎么做app拉新推广
  • 软件开发做网站淘宝指数在哪里查询
  • apicloud官网杭州专业seo服务公司
  • 做类似起点的网站百度经验首页登录官网
  • 专做机械零配件的网站百度快速收录账号购买
  • 衡水做网站的公司学校教育培训机构
  • intitle 网站建设长尾关键词爱站网
  • php网站开发过程关键字优化用什么系统
  • 用php做的网站必备那些文件市场运营和市场营销的区别
  • 可以做h5游戏的网站济南网站建设公司
  • 凡客诚品官方在哪个网店进行seo网站建设