在ES上插入没有元数据行的JSON数据

时间:2018-03-27 05:42:17

标签: elasticsearch kibana elastic-stack

有没有办法在ES或Kibana上插入没有元数据行的json数据? 或自动创建索引行?

我的数据看起来像这样。

  {"time_slot":"2013-12-31T15:00:00.000Z","line_num":"1호선","line_num_en":"Line 1","station_name":"서울역","station_name_kr":"서울역","station_name_en":"Seoul Station","station_name_chc":"-","station_name_ch":"首?站","station_name_jp":"ソウルヨク","station_geo":{"lat":37.554648,"lon":126.972559},"people_in":91,"people_out":172}

我知道使用批量API,json数据应该是元数据索引行

  {"index": {"_index" : "seoul-metro_2014-2","_type":"kr-subway","_id":"0"}}
  {"time_slot":"2013-12-31T15:00:00.000Z","line_num":"1호선","line_num_en":"Line 1","station_name":"서울역","station_name_kr":"서울역","station_name_en":"Seoul Station","station_name_chc":"-","station_name_ch":"首?站","station_name_jp":"ソウルヨク","station_geo":{"lat":37.554648,"lon":126.972559},"people_in":91,"people_out":172}

但实际数据没有元数据线,

  {"index": {"_index" : "seoul-metro_2014-2","_type":"kr-subway","_id":"0"}}

所以我只是想知道我是否想在ES上使用批量API,

我应该将每个元数据行放到原始json数据中吗? 但如果数据巨大,我该如何插入ES?

0 个答案:

没有答案