use-a-data-stream.asciidoc 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. [role="xpack"]
  2. [[use-a-data-stream]]
  3. == Use a data stream
  4. After you <<set-up-a-data-stream,set up a data stream>>, you can do
  5. the following:
  6. * <<add-documents-to-a-data-stream>>
  7. * <<search-a-data-stream>>
  8. * <<get-stats-for-a-data-stream>>
  9. * <<manually-roll-over-a-data-stream>>
  10. * <<open-closed-backing-indices>>
  11. * <<reindex-with-a-data-stream>>
  12. * <<update-docs-in-a-data-stream-by-query>>
  13. * <<delete-docs-in-a-data-stream-by-query>>
  14. * <<update-delete-docs-in-a-backing-index>>
  15. ////
  16. [source,console]
  17. ----
  18. PUT /_index_template/logs_data_stream
  19. {
  20. "index_patterns": [ "logs*" ],
  21. "data_stream": { }
  22. }
  23. PUT /_data_stream/logs
  24. POST /logs/_rollover/
  25. POST /logs/_rollover/
  26. PUT /logs/_create/bfspvnIBr7VVZlfp2lqX?refresh=wait_for
  27. {
  28. "@timestamp": "2020-12-07T11:06:07.000Z",
  29. "user": {
  30. "id": "yWIumJd7"
  31. },
  32. "message": "Login successful"
  33. }
  34. PUT /_data_stream/logs_alt
  35. ----
  36. // TESTSETUP
  37. [source,console]
  38. ----
  39. DELETE /_data_stream/*
  40. DELETE /_index_template/*
  41. ----
  42. // TEARDOWN
  43. ////
  44. [discrete]
  45. [[add-documents-to-a-data-stream]]
  46. === Add documents to a data stream
  47. You can add documents to a data stream using two types of indexing requests:
  48. * <<data-streams-individual-indexing-requests>>
  49. * <<data-streams-bulk-indexing-requests>>
  50. Adding a document to a data stream adds the document to stream's current
  51. <<data-stream-write-index,write index>>.
  52. You cannot add new documents to a stream's other backing indices, even by
  53. sending requests directly to the index. This means you cannot submit the
  54. following requests directly to any backing index except the write index:
  55. * An <<docs-index_,index API>> request with an
  56. <<docs-index-api-op_type,`op_type`>> of `create`. The `op_type` parameter
  57. defaults to `create` when adding new documents.
  58. * A <<docs-bulk,bulk API>> request using a `create` action
  59. [discrete]
  60. [[data-streams-individual-indexing-requests]]
  61. ==== Individual indexing requests
  62. You can use an <<docs-index_,index API>> request with an
  63. <<docs-index-api-op_type,`op_type`>> of `create` to add individual documents
  64. to a data stream.
  65. NOTE: The `op_type` parameter defaults to `create` when adding new documents.
  66. The following index API request adds a new document to the `logs` data
  67. stream.
  68. [source,console]
  69. ----
  70. POST /logs/_doc/
  71. {
  72. "@timestamp": "2020-12-07T11:06:07.000Z",
  73. "user": {
  74. "id": "8a4f500d"
  75. },
  76. "message": "Login successful"
  77. }
  78. ----
  79. IMPORTANT: You cannot add new documents to a data stream using the index API's
  80. `PUT /<target>/_doc/<_id>` request format. To specify a document ID, use the
  81. `PUT /<target>/_create/<_id>` format instead.
  82. [discrete]
  83. [[data-streams-bulk-indexing-requests]]
  84. ==== Bulk indexing requests
  85. You can use the <<docs-bulk,bulk API>> to add multiple documents to a data
  86. stream in a single request. Each action in the bulk request must use the
  87. `create` action.
  88. NOTE: Data streams do not support other bulk actions, such as `index`.
  89. The following bulk API request adds several new documents to
  90. the `logs` data stream. Note that only the `create` action is used.
  91. [source,console]
  92. ----
  93. PUT /logs/_bulk?refresh
  94. {"create":{ }}
  95. { "@timestamp": "2020-12-08T11:04:05.000Z", "user": { "id": "vlb44hny" }, "message": "Login attempt failed" }
  96. {"create":{ }}
  97. { "@timestamp": "2020-12-08T11:06:07.000Z", "user": { "id": "8a4f500d" }, "message": "Login successful" }
  98. {"create":{ }}
  99. { "@timestamp": "2020-12-09T11:07:08.000Z", "user": { "id": "l7gk7f82" }, "message": "Logout successful" }
  100. ----
  101. [discrete]
  102. [[data-streams-index-with-an-ingest-pipeline]]
  103. ==== Index with an ingest pipeline
  104. You can use an <<ingest,ingest pipeline>> with an indexing request to
  105. pre-process data before it's indexed to a data stream.
  106. The following <<put-pipeline-api,put pipeline API>> request creates the
  107. `lowercase_message_field` ingest pipeline. The pipeline uses the
  108. <<lowercase-processor,`lowercase` ingest processor>> to change the `message`
  109. field value to lowercase before indexing.
  110. [source,console]
  111. ----
  112. PUT /_ingest/pipeline/lowercase_message_field
  113. {
  114. "description" : "Lowercases the message field value",
  115. "processors" : [
  116. {
  117. "lowercase" : {
  118. "field" : "message"
  119. }
  120. }
  121. ]
  122. }
  123. ----
  124. // TEST[continued]
  125. The following index API request adds a new document to the `logs` data stream.
  126. The request includes a `?pipeline=lowercase_message_field` query parameter.
  127. This parameter indicates {es} should use the `lowercase_message_field` pipeline
  128. to pre-process the document before indexing it.
  129. During pre-processing, the pipeline changes the letter case of the document's
  130. `message` field value from `LOGIN Successful` to `login successful`.
  131. [source,console]
  132. ----
  133. POST /logs/_doc?pipeline=lowercase_message_field
  134. {
  135. "@timestamp": "2020-12-08T11:12:01.000Z",
  136. "user": {
  137. "id": "I1YBEOxJ"
  138. },
  139. "message": "LOGIN Successful"
  140. }
  141. ----
  142. // TEST[continued]
  143. ////
  144. [source,console]
  145. ----
  146. DELETE /_ingest/pipeline/lowercase_message_field
  147. ----
  148. // TEST[continued]
  149. ////
  150. [discrete]
  151. [[search-a-data-stream]]
  152. === Search a data stream
  153. The following search APIs support data streams:
  154. * <<search-search, Search>>
  155. * <<async-search, Async search>>
  156. * <<search-multi-search, Multi search>>
  157. * <<search-field-caps, Field capabilities>>
  158. * <<eql-search-api, EQL search>>
  159. The following <<search-search,search API>> request searches the `logs` data
  160. stream for documents with a timestamp between today and yesterday that also have
  161. `message` value of `login successful`.
  162. [source,console]
  163. ----
  164. GET /logs/_search
  165. {
  166. "query": {
  167. "bool": {
  168. "must": {
  169. "range": {
  170. "@timestamp": {
  171. "gte": "now-1d/d",
  172. "lt": "now/d"
  173. }
  174. }
  175. },
  176. "should": {
  177. "match": {
  178. "message": "login successful"
  179. }
  180. }
  181. }
  182. }
  183. }
  184. ----
  185. You can use a comma-separated list or wildcard (`*`) expression to search
  186. multiple data streams, indices, and index aliases in the same request.
  187. The following request searches the `logs` and `logs_alt` data streams, which are
  188. specified as a comma-separated list in the request path.
  189. [source,console]
  190. ----
  191. GET /logs,logs_alt/_search
  192. {
  193. "query": {
  194. "match": {
  195. "user.id": "8a4f500d"
  196. }
  197. }
  198. }
  199. ----
  200. The following request uses the `logs*` wildcard expression to search any data
  201. stream, index, or index alias beginning with `logs`.
  202. [source,console]
  203. ----
  204. GET /logs*/_search
  205. {
  206. "query": {
  207. "match": {
  208. "user.id": "vlb44hny"
  209. }
  210. }
  211. }
  212. ----
  213. The following search request omits a target in the request path. The request
  214. searches all data streams and indices in the cluster.
  215. [source,console]
  216. ----
  217. GET /_search
  218. {
  219. "query": {
  220. "match": {
  221. "user.id": "l7gk7f82"
  222. }
  223. }
  224. }
  225. ----
  226. [discrete]
  227. [[get-stats-for-a-data-stream]]
  228. === Get statistics for a data stream
  229. You can use the <<data-stream-stats-api,data stream stats API>> to retrieve
  230. statistics for one or more data streams. These statistics include:
  231. * A count of the stream's backing indices
  232. * The total store size of all shards for the stream's backing indices
  233. * The highest `@timestamp` value for the stream
  234. .*Example*
  235. [%collapsible]
  236. ====
  237. The following data stream stats API request retrieves statistics for the
  238. `logs` data stream.
  239. [source,console]
  240. ----
  241. GET /_data_stream/logs/_stats?human=true
  242. ----
  243. The API returns the following response.
  244. [source,console-result]
  245. ----
  246. {
  247. "_shards": {
  248. "total": 6,
  249. "successful": 3,
  250. "failed": 0
  251. },
  252. "data_stream_count": 1,
  253. "backing_indices": 3,
  254. "total_store_size": "624b",
  255. "total_store_size_bytes": 624,
  256. "data_streams": [
  257. {
  258. "data_stream": "logs",
  259. "backing_indices": 3,
  260. "store_size": "624b",
  261. "store_size_bytes": 624,
  262. "maximum_timestamp": 1607339167000
  263. }
  264. ]
  265. }
  266. ----
  267. // TESTRESPONSE[s/"total_store_size": "624b"/"total_store_size": $body.total_store_size/]
  268. // TESTRESPONSE[s/"total_store_size_bytes": 624/"total_store_size_bytes": $body.total_store_size_bytes/]
  269. // TESTRESPONSE[s/"store_size": "624b"/"store_size": $body.data_streams.0.store_size/]
  270. // TESTRESPONSE[s/"store_size_bytes": 624/"store_size_bytes": $body.data_streams.0.store_size_bytes/]
  271. ====
  272. [discrete]
  273. [[manually-roll-over-a-data-stream]]
  274. === Manually roll over a data stream
  275. A rollover creates a new backing index for a data stream. This new backing index
  276. becomes the stream's <<data-stream-write-index,write index>> and increments
  277. the stream's <<data-streams-generation,generation>>.
  278. In most cases, we recommend using <<index-lifecycle-management,{ilm-init}>> to
  279. automate rollovers for data streams. This lets you automatically roll over the
  280. current write index when it meets specified criteria, such as a maximum age or
  281. size.
  282. However, you can also use the <<indices-rollover-index,rollover API>> to
  283. manually perform a rollover. This can be useful if you want to
  284. <<data-streams-change-mappings-and-settings,apply mapping or setting changes>>
  285. to the stream's write index after updating a data stream's template.
  286. The following <<indices-rollover-index,rollover API>> request submits a manual
  287. rollover request for the `logs` data stream.
  288. [source,console]
  289. ----
  290. POST /logs/_rollover/
  291. ----
  292. [discrete]
  293. [[open-closed-backing-indices]]
  294. === Open closed backing indices
  295. You may <<indices-close,close>> one or more of a data stream's backing indices
  296. as part of its {ilm-init} lifecycle or another workflow. A closed backing index
  297. cannot be searched, even for searches targeting its data stream. You also can't
  298. <<update-docs-in-a-data-stream-by-query,update>> or
  299. <<delete-docs-in-a-data-stream-by-query,delete>> documents in a closed index.
  300. You can re-open individual backing indices by sending an
  301. <<indices-open-close,open request>> directly to the index.
  302. You also can conveniently re-open all closed backing indices for a data stream
  303. by sending an open request directly to the stream.
  304. The following <<cat-indices,cat indices>> API request retrieves the status for
  305. the `logs` data stream's backing indices.
  306. ////
  307. [source,console]
  308. ----
  309. POST /.ds-logs-000001,.ds-logs-000002/_close/
  310. ----
  311. ////
  312. [source,console]
  313. ----
  314. GET /_cat/indices/logs?v&s=index&h=index,status
  315. ----
  316. // TEST[continued]
  317. The API returns the following response. The response indicates the `logs` data
  318. stream contains two closed backing indices: `.ds-logs-000001` and
  319. `.ds-logs-000002`.
  320. [source,txt]
  321. ----
  322. index status
  323. .ds-logs-000001 close
  324. .ds-logs-000002 close
  325. .ds-logs-000003 open
  326. ----
  327. // TESTRESPONSE[non_json]
  328. The following <<indices-open-close,open API>> request re-opens any closed
  329. backing indices for the `logs` data stream, including `.ds-logs-000001` and
  330. `.ds-logs-000002`.
  331. [source,console]
  332. ----
  333. POST /logs/_open/
  334. ----
  335. // TEST[continued]
  336. You can resubmit the original cat indices API request to verify the
  337. `.ds-logs-000001` and `.ds-logs-000002` backing indices were re-opened.
  338. [source,console]
  339. ----
  340. GET /_cat/indices/logs?v&s=index&h=index,status
  341. ----
  342. // TEST[continued]
  343. The API returns the following response.
  344. [source,txt]
  345. ----
  346. index status
  347. .ds-logs-000001 open
  348. .ds-logs-000002 open
  349. .ds-logs-000003 open
  350. ----
  351. // TESTRESPONSE[non_json]
  352. [discrete]
  353. [[reindex-with-a-data-stream]]
  354. === Reindex with a data stream
  355. You can use the <<docs-reindex,reindex API>> to copy documents to a data stream
  356. from an existing index, index alias, or data stream.
  357. A reindex copies documents from a _source_ to a _destination_. The source and
  358. destination can be any pre-existing index, index alias, or data stream. However,
  359. the source and destination must be different. You cannot reindex a data stream
  360. into itself.
  361. Because data streams are <<data-streams-append-only,append-only>>, a reindex
  362. request to a data stream destination must have an `op_type` of `create`. This
  363. means a reindex can only add new documents to a data stream. It cannot update
  364. existing documents in the data stream destination.
  365. A reindex can be used to:
  366. * Convert an existing index alias and collection of time-based indices into a
  367. data stream.
  368. * Apply a new or updated <<create-a-data-stream-template,index template>>
  369. by reindexing an existing data stream into a new one. This applies mapping
  370. and setting changes in the template to each document and backing index of the
  371. data stream destination. See
  372. <<data-streams-use-reindex-to-change-mappings-settings>>.
  373. TIP: If you only want to update the mappings or settings of a data stream's
  374. write index, we recommend you update the <<create-a-data-stream-template,data
  375. stream's template>> and perform a <<manually-roll-over-a-data-stream,rollover>>.
  376. The following reindex request copies documents from the `archive` index alias to
  377. the existing `logs` data stream. Because the destination is a data stream, the
  378. request's `op_type` is `create`.
  379. ////
  380. [source,console]
  381. ----
  382. PUT /_bulk?refresh=wait_for
  383. {"create":{"_index" : "archive_1"}}
  384. { "@timestamp": "2020-12-08T11:04:05.000Z" }
  385. {"create":{"_index" : "archive_2"}}
  386. { "@timestamp": "2020-12-08T11:06:07.000Z" }
  387. {"create":{"_index" : "archive_2"}}
  388. { "@timestamp": "2020-12-09T11:07:08.000Z" }
  389. {"create":{"_index" : "archive_2"}}
  390. { "@timestamp": "2020-12-09T11:07:08.000Z" }
  391. POST /_aliases
  392. {
  393. "actions" : [
  394. { "add" : { "index" : "archive_1", "alias" : "archive" } },
  395. { "add" : { "index" : "archive_2", "alias" : "archive", "is_write_index" : true} }
  396. ]
  397. }
  398. ----
  399. ////
  400. [source,console]
  401. ----
  402. POST /_reindex
  403. {
  404. "source": {
  405. "index": "archive"
  406. },
  407. "dest": {
  408. "index": "logs",
  409. "op_type": "create"
  410. }
  411. }
  412. ----
  413. // TEST[continued]
  414. You can also reindex documents from a data stream to an index, index
  415. alias, or data stream.
  416. The following reindex request copies documents from the `logs` data stream
  417. to the existing `archive` index alias. Because the destination is not a data
  418. stream, the `op_type` does not need to be specified.
  419. [source,console]
  420. ----
  421. POST /_reindex
  422. {
  423. "source": {
  424. "index": "logs"
  425. },
  426. "dest": {
  427. "index": "archive"
  428. }
  429. }
  430. ----
  431. // TEST[continued]
  432. [discrete]
  433. [[update-docs-in-a-data-stream-by-query]]
  434. === Update documents in a data stream by query
  435. You cannot send indexing or update requests for existing documents directly to a
  436. data stream. These prohibited requests include:
  437. * An <<docs-index_,index API>> request with an
  438. <<docs-index-api-op_type,`op_type`>> of `index`. The `op_type` parameter
  439. defaults to `index` for existing documents.
  440. * A <<docs-bulk,bulk API>> request using the `index` or `update`
  441. action.
  442. Instead, you can use the <<docs-update-by-query,update by query API>> to update
  443. documents in a data stream that matches a provided query.
  444. The following update by query request updates documents in the `logs` data
  445. stream with a `user.id` of `l7gk7f82`. The request uses a
  446. <<modules-scripting-using,script>> to assign matching documents a new `user.id`
  447. value of `XgdX0NoX`.
  448. [source,console]
  449. ----
  450. POST /logs/_update_by_query
  451. {
  452. "query": {
  453. "match": {
  454. "user.id": "l7gk7f82"
  455. }
  456. },
  457. "script": {
  458. "source": "ctx._source.user.id = params.new_id",
  459. "params": {
  460. "new_id": "XgdX0NoX"
  461. }
  462. }
  463. }
  464. ----
  465. [discrete]
  466. [[delete-docs-in-a-data-stream-by-query]]
  467. === Delete documents in a data stream by query
  468. You cannot send document deletion requests directly to a data stream. These
  469. prohibited requests include:
  470. * A <<docs-delete,delete API>> request
  471. * A <<docs-bulk,bulk API>> request using the `delete` action.
  472. Instead, you can use the <<docs-delete-by-query,delete by query API>> to delete
  473. documents in a data stream that matches a provided query.
  474. The following delete by query request deletes documents in the `logs` data
  475. stream with a `user.id` of `vlb44hny`.
  476. [source,console]
  477. ----
  478. POST /logs/_delete_by_query
  479. {
  480. "query": {
  481. "match": {
  482. "user.id": "vlb44hny"
  483. }
  484. }
  485. }
  486. ----
  487. [discrete]
  488. [[update-delete-docs-in-a-backing-index]]
  489. === Update or delete documents in a backing index
  490. Alternatively, you can update or delete documents in a data stream by sending
  491. the update or deletion request to the backing index containing the document. To
  492. do this, you first need to get:
  493. * The <<mapping-id-field,document ID>>
  494. * The name of the backing index that contains the document
  495. If you want to update a document, you must also get its current
  496. <<optimistic-concurrency-control,sequence number and primary term>>.
  497. You can use a <<search-a-data-stream,search request>> to retrieve this
  498. information.
  499. The following search request retrieves documents in the `logs` data stream with
  500. a `user.id` of `yWIumJd7`. By default, this search returns the document ID and
  501. backing index for any matching documents.
  502. The request includes a `"seq_no_primary_term": true` argument. This means the
  503. search also returns the sequence number and primary term for any matching
  504. documents.
  505. [source,console]
  506. ----
  507. GET /logs/_search
  508. {
  509. "seq_no_primary_term": true,
  510. "query": {
  511. "match": {
  512. "user.id": "yWIumJd7"
  513. }
  514. }
  515. }
  516. ----
  517. The API returns the following response. The `hits.hits` property contains
  518. information for any documents matching the search.
  519. [source,console-result]
  520. ----
  521. {
  522. "took": 20,
  523. "timed_out": false,
  524. "_shards": {
  525. "total": 3,
  526. "successful": 3,
  527. "skipped": 0,
  528. "failed": 0
  529. },
  530. "hits": {
  531. "total": {
  532. "value": 1,
  533. "relation": "eq"
  534. },
  535. "max_score": 0.2876821,
  536. "hits": [
  537. {
  538. "_index": ".ds-logs-000003", <1>
  539. "_id": "bfspvnIBr7VVZlfp2lqX", <2>
  540. "_seq_no": 0, <3>
  541. "_primary_term": 1, <4>
  542. "_score": 0.2876821,
  543. "_source": {
  544. "@timestamp": "2020-12-07T11:06:07.000Z",
  545. "user": {
  546. "id": "yWIumJd7"
  547. },
  548. "message": "Login successful"
  549. }
  550. }
  551. ]
  552. }
  553. }
  554. ----
  555. // TESTRESPONSE[s/"took": 20/"took": $body.took/]
  556. // TESTRESPONSE[s/"max_score": 0.2876821/"max_score": $body.hits.max_score/]
  557. // TESTRESPONSE[s/"_score": 0.2876821/"_score": $body.hits.hits.0._score/]
  558. <1> Backing index containing the matching document
  559. <2> Document ID for the document
  560. <3> Current sequence number for the document
  561. <4> Primary term for the document
  562. You can use an <<docs-index_,index API>> request to update an individual
  563. document. To prevent an accidental overwrite, this request must include valid
  564. `if_seq_no` and `if_primary_term` arguments.
  565. The following index API request updates an existing document in the `logs` data
  566. stream. The request targets document ID `bfspvnIBr7VVZlfp2lqX` in the
  567. `.ds-logs-000003` backing index.
  568. The request also includes the current sequence number and primary term in the
  569. respective `if_seq_no` and `if_primary_term` query parameters. The request body
  570. contains a new JSON source for the document.
  571. [source,console]
  572. ----
  573. PUT /.ds-logs-000003/_doc/bfspvnIBr7VVZlfp2lqX?if_seq_no=0&if_primary_term=1
  574. {
  575. "@timestamp": "2020-12-07T11:06:07.000Z",
  576. "user": {
  577. "id": "8a4f500d"
  578. },
  579. "message": "Login successful"
  580. }
  581. ----
  582. You use the <<docs-delete,delete API>> to delete individual documents. Deletion
  583. requests do not require a sequence number or primary term.
  584. The following index API request deletes an existing document in the `logs` data
  585. stream. The request targets document ID `bfspvnIBr7VVZlfp2lqX` in the
  586. `.ds-logs-000003` backing index.
  587. [source,console]
  588. ----
  589. DELETE /.ds-logs-000003/_doc/bfspvnIBr7VVZlfp2lqX
  590. ----
  591. You can use the <<docs-bulk,bulk API>> to delete or update multiple documents in
  592. one request using `delete`, `index`, or `update` actions.
  593. If the action type is `index`, the action must include valid
  594. <<bulk-optimistic-concurrency-control,`if_seq_no` and `if_primary_term`>>
  595. arguments.
  596. The following bulk API request uses an `index` action to update an existing
  597. document in the `logs` data stream.
  598. The `index` action targets document ID `bfspvnIBr7VVZlfp2lqX` in the
  599. `.ds-logs-000003` backing index. The action also includes the current sequence
  600. number and primary term in the respective `if_seq_no` and `if_primary_term`
  601. parameters.
  602. [source,console]
  603. ----
  604. PUT /_bulk?refresh
  605. { "index": { "_index": ".ds-logs-000003", "_id": "bfspvnIBr7VVZlfp2lqX", "if_seq_no": 0, "if_primary_term": 1 } }
  606. { "@timestamp": "2020-12-07T11:06:07.000Z", "user": { "id": "8a4f500d" }, "message": "Login successful" }
  607. ----