use-a-data-stream.asciidoc 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  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. ////
  159. * <<eql-search-api, EQL search>>
  160. ////
  161. The following <<search-search,search API>> request searches the `logs` data
  162. stream for documents with a timestamp between today and yesterday that also have
  163. `message` value of `login successful`.
  164. [source,console]
  165. ----
  166. GET /logs/_search
  167. {
  168. "query": {
  169. "bool": {
  170. "must": {
  171. "range": {
  172. "@timestamp": {
  173. "gte": "now-1d/d",
  174. "lt": "now/d"
  175. }
  176. }
  177. },
  178. "should": {
  179. "match": {
  180. "message": "login successful"
  181. }
  182. }
  183. }
  184. }
  185. }
  186. ----
  187. You can use a comma-separated list or wildcard (`*`) expression to search
  188. multiple data streams, indices, and index aliases in the same request.
  189. The following request searches the `logs` and `logs_alt` data streams, which are
  190. specified as a comma-separated list in the request path.
  191. [source,console]
  192. ----
  193. GET /logs,logs_alt/_search
  194. {
  195. "query": {
  196. "match": {
  197. "user.id": "8a4f500d"
  198. }
  199. }
  200. }
  201. ----
  202. The following request uses the `logs*` wildcard expression to search any data
  203. stream, index, or index alias beginning with `logs`.
  204. [source,console]
  205. ----
  206. GET /logs*/_search
  207. {
  208. "query": {
  209. "match": {
  210. "user.id": "vlb44hny"
  211. }
  212. }
  213. }
  214. ----
  215. The following search request omits a target in the request path. The request
  216. searches all data streams and indices in the cluster.
  217. [source,console]
  218. ----
  219. GET /_search
  220. {
  221. "query": {
  222. "match": {
  223. "user.id": "l7gk7f82"
  224. }
  225. }
  226. }
  227. ----
  228. [discrete]
  229. [[get-stats-for-a-data-stream]]
  230. === Get statistics for a data stream
  231. You can use the <<data-stream-stats-api,data stream stats API>> to retrieve
  232. statistics for one or more data streams. These statistics include:
  233. * A count of the stream's backing indices
  234. * The total store size of all shards for the stream's backing indices
  235. * The highest `@timestamp` value for the stream
  236. .*Example*
  237. [%collapsible]
  238. ====
  239. The following data stream stats API request retrieves statistics for the
  240. `logs` data stream.
  241. [source,console]
  242. ----
  243. GET /_data_stream/logs/_stats?human=true
  244. ----
  245. The API returns the following response.
  246. [source,console-result]
  247. ----
  248. {
  249. "_shards": {
  250. "total": 6,
  251. "successful": 3,
  252. "failed": 0
  253. },
  254. "data_stream_count": 1,
  255. "backing_indices": 3,
  256. "total_store_size": "624b",
  257. "total_store_size_bytes": 624,
  258. "data_streams": [
  259. {
  260. "data_stream": "logs",
  261. "backing_indices": 3,
  262. "store_size": "624b",
  263. "store_size_bytes": 624,
  264. "maximum_timestamp": 1607339167000
  265. }
  266. ]
  267. }
  268. ----
  269. // TESTRESPONSE[s/"total_store_size": "624b"/"total_store_size": $body.total_store_size/]
  270. // TESTRESPONSE[s/"total_store_size_bytes": 624/"total_store_size_bytes": $body.total_store_size_bytes/]
  271. // TESTRESPONSE[s/"store_size": "624b"/"store_size": $body.data_streams.0.store_size/]
  272. // TESTRESPONSE[s/"store_size_bytes": 624/"store_size_bytes": $body.data_streams.0.store_size_bytes/]
  273. ====
  274. [discrete]
  275. [[manually-roll-over-a-data-stream]]
  276. === Manually roll over a data stream
  277. A rollover creates a new backing index for a data stream. This new backing index
  278. becomes the stream's <<data-stream-write-index,write index>> and increments
  279. the stream's <<data-streams-generation,generation>>.
  280. In most cases, we recommend using <<index-lifecycle-management,{ilm-init}>> to
  281. automate rollovers for data streams. This lets you automatically roll over the
  282. current write index when it meets specified criteria, such as a maximum age or
  283. size.
  284. However, you can also use the <<indices-rollover-index,rollover API>> to
  285. manually perform a rollover. This can be useful if you want to
  286. <<data-streams-change-mappings-and-settings,apply mapping or setting changes>>
  287. to the stream's write index after updating a data stream's template.
  288. The following <<indices-rollover-index,rollover API>> request submits a manual
  289. rollover request for the `logs` data stream.
  290. [source,console]
  291. ----
  292. POST /logs/_rollover/
  293. ----
  294. [discrete]
  295. [[open-closed-backing-indices]]
  296. === Open closed backing indices
  297. You may <<indices-close,close>> one or more of a data stream's backing indices
  298. as part of its {ilm-init} lifecycle or another workflow. A closed backing index
  299. cannot be searched, even for searches targeting its data stream. You also can't
  300. <<update-docs-in-a-data-stream-by-query,update>> or
  301. <<delete-docs-in-a-data-stream-by-query,delete>> documents in a closed index.
  302. You can re-open individual backing indices by sending an
  303. <<indices-open-close,open request>> directly to the index.
  304. You also can conveniently re-open all closed backing indices for a data stream
  305. by sending an open request directly to the stream.
  306. The following <<cat-indices,cat indices>> API request retrieves the status for
  307. the `logs` data stream's backing indices.
  308. ////
  309. [source,console]
  310. ----
  311. POST /.ds-logs-000001,.ds-logs-000002/_close/
  312. ----
  313. ////
  314. [source,console]
  315. ----
  316. GET /_cat/indices/logs?v&s=index&h=index,status
  317. ----
  318. // TEST[continued]
  319. The API returns the following response. The response indicates the `logs` data
  320. stream contains two closed backing indices: `.ds-logs-000001` and
  321. `.ds-logs-000002`.
  322. [source,txt]
  323. ----
  324. index status
  325. .ds-logs-000001 close
  326. .ds-logs-000002 close
  327. .ds-logs-000003 open
  328. ----
  329. // TESTRESPONSE[non_json]
  330. The following <<indices-open-close,open API>> request re-opens any closed
  331. backing indices for the `logs` data stream, including `.ds-logs-000001` and
  332. `.ds-logs-000002`.
  333. [source,console]
  334. ----
  335. POST /logs/_open/
  336. ----
  337. // TEST[continued]
  338. You can resubmit the original cat indices API request to verify the
  339. `.ds-logs-000001` and `.ds-logs-000002` backing indices were re-opened.
  340. [source,console]
  341. ----
  342. GET /_cat/indices/logs?v&s=index&h=index,status
  343. ----
  344. // TEST[continued]
  345. The API returns the following response.
  346. [source,txt]
  347. ----
  348. index status
  349. .ds-logs-000001 open
  350. .ds-logs-000002 open
  351. .ds-logs-000003 open
  352. ----
  353. // TESTRESPONSE[non_json]
  354. [discrete]
  355. [[reindex-with-a-data-stream]]
  356. === Reindex with a data stream
  357. You can use the <<docs-reindex,reindex API>> to copy documents to a data stream
  358. from an existing index, index alias, or data stream.
  359. A reindex copies documents from a _source_ to a _destination_. The source and
  360. destination can be any pre-existing index, index alias, or data stream. However,
  361. the source and destination must be different. You cannot reindex a data stream
  362. into itself.
  363. Because data streams are <<data-streams-append-only,append-only>>, a reindex
  364. request to a data stream destination must have an `op_type` of `create`. This
  365. means a reindex can only add new documents to a data stream. It cannot update
  366. existing documents in the data stream destination.
  367. A reindex can be used to:
  368. * Convert an existing index alias and collection of time-based indices into a
  369. data stream.
  370. * Apply a new or updated <<create-a-data-stream-template,index template>>
  371. by reindexing an existing data stream into a new one. This applies mapping
  372. and setting changes in the template to each document and backing index of the
  373. data stream destination. See
  374. <<data-streams-use-reindex-to-change-mappings-settings>>.
  375. TIP: If you only want to update the mappings or settings of a data stream's
  376. write index, we recommend you update the <<create-a-data-stream-template,data
  377. stream's template>> and perform a <<manually-roll-over-a-data-stream,rollover>>.
  378. The following reindex request copies documents from the `archive` index alias to
  379. the existing `logs` data stream. Because the destination is a data stream, the
  380. request's `op_type` is `create`.
  381. ////
  382. [source,console]
  383. ----
  384. PUT /_bulk?refresh=wait_for
  385. {"create":{"_index" : "archive_1"}}
  386. { "@timestamp": "2020-12-08T11:04:05.000Z" }
  387. {"create":{"_index" : "archive_2"}}
  388. { "@timestamp": "2020-12-08T11:06:07.000Z" }
  389. {"create":{"_index" : "archive_2"}}
  390. { "@timestamp": "2020-12-09T11:07:08.000Z" }
  391. {"create":{"_index" : "archive_2"}}
  392. { "@timestamp": "2020-12-09T11:07:08.000Z" }
  393. POST /_aliases
  394. {
  395. "actions" : [
  396. { "add" : { "index" : "archive_1", "alias" : "archive" } },
  397. { "add" : { "index" : "archive_2", "alias" : "archive", "is_write_index" : true} }
  398. ]
  399. }
  400. ----
  401. ////
  402. [source,console]
  403. ----
  404. POST /_reindex
  405. {
  406. "source": {
  407. "index": "archive"
  408. },
  409. "dest": {
  410. "index": "logs",
  411. "op_type": "create"
  412. }
  413. }
  414. ----
  415. // TEST[continued]
  416. You can also reindex documents from a data stream to an index, index
  417. alias, or data stream.
  418. The following reindex request copies documents from the `logs` data stream
  419. to the existing `archive` index alias. Because the destination is not a data
  420. stream, the `op_type` does not need to be specified.
  421. [source,console]
  422. ----
  423. POST /_reindex
  424. {
  425. "source": {
  426. "index": "logs"
  427. },
  428. "dest": {
  429. "index": "archive"
  430. }
  431. }
  432. ----
  433. // TEST[continued]
  434. [discrete]
  435. [[update-docs-in-a-data-stream-by-query]]
  436. === Update documents in a data stream by query
  437. You cannot send indexing or update requests for existing documents directly to a
  438. data stream. These prohibited requests include:
  439. * An <<docs-index_,index API>> request with an
  440. <<docs-index-api-op_type,`op_type`>> of `index`. The `op_type` parameter
  441. defaults to `index` for existing documents.
  442. * A <<docs-bulk,bulk API>> request using the `index` or `update`
  443. action.
  444. Instead, you can use the <<docs-update-by-query,update by query API>> to update
  445. documents in a data stream that matches a provided query.
  446. The following update by query request updates documents in the `logs` data
  447. stream with a `user.id` of `l7gk7f82`. The request uses a
  448. <<modules-scripting-using,script>> to assign matching documents a new `user.id`
  449. value of `XgdX0NoX`.
  450. [source,console]
  451. ----
  452. POST /logs/_update_by_query
  453. {
  454. "query": {
  455. "match": {
  456. "user.id": "l7gk7f82"
  457. }
  458. },
  459. "script": {
  460. "source": "ctx._source.user.id = params.new_id",
  461. "params": {
  462. "new_id": "XgdX0NoX"
  463. }
  464. }
  465. }
  466. ----
  467. [discrete]
  468. [[delete-docs-in-a-data-stream-by-query]]
  469. === Delete documents in a data stream by query
  470. You cannot send document deletion requests directly to a data stream. These
  471. prohibited requests include:
  472. * A <<docs-delete,delete API>> request
  473. * A <<docs-bulk,bulk API>> request using the `delete` action.
  474. Instead, you can use the <<docs-delete-by-query,delete by query API>> to delete
  475. documents in a data stream that matches a provided query.
  476. The following delete by query request deletes documents in the `logs` data
  477. stream with a `user.id` of `vlb44hny`.
  478. [source,console]
  479. ----
  480. POST /logs/_delete_by_query
  481. {
  482. "query": {
  483. "match": {
  484. "user.id": "vlb44hny"
  485. }
  486. }
  487. }
  488. ----
  489. [discrete]
  490. [[update-delete-docs-in-a-backing-index]]
  491. === Update or delete documents in a backing index
  492. Alternatively, you can update or delete documents in a data stream by sending
  493. the update or deletion request to the backing index containing the document. To
  494. do this, you first need to get:
  495. * The <<mapping-id-field,document ID>>
  496. * The name of the backing index that contains the document
  497. If you want to update a document, you must also get its current
  498. <<optimistic-concurrency-control,sequence number and primary term>>.
  499. You can use a <<search-a-data-stream,search request>> to retrieve this
  500. information.
  501. The following search request retrieves documents in the `logs` data stream with
  502. a `user.id` of `yWIumJd7`. By default, this search returns the document ID and
  503. backing index for any matching documents.
  504. The request includes a `"seq_no_primary_term": true` argument. This means the
  505. search also returns the sequence number and primary term for any matching
  506. documents.
  507. [source,console]
  508. ----
  509. GET /logs/_search
  510. {
  511. "seq_no_primary_term": true,
  512. "query": {
  513. "match": {
  514. "user.id": "yWIumJd7"
  515. }
  516. }
  517. }
  518. ----
  519. The API returns the following response. The `hits.hits` property contains
  520. information for any documents matching the search.
  521. [source,console-result]
  522. ----
  523. {
  524. "took": 20,
  525. "timed_out": false,
  526. "_shards": {
  527. "total": 3,
  528. "successful": 3,
  529. "skipped": 0,
  530. "failed": 0
  531. },
  532. "hits": {
  533. "total": {
  534. "value": 1,
  535. "relation": "eq"
  536. },
  537. "max_score": 0.2876821,
  538. "hits": [
  539. {
  540. "_index": ".ds-logs-000003", <1>
  541. "_id": "bfspvnIBr7VVZlfp2lqX", <2>
  542. "_seq_no": 0, <3>
  543. "_primary_term": 1, <4>
  544. "_score": 0.2876821,
  545. "_source": {
  546. "@timestamp": "2020-12-07T11:06:07.000Z",
  547. "user": {
  548. "id": "yWIumJd7"
  549. },
  550. "message": "Login successful"
  551. }
  552. }
  553. ]
  554. }
  555. }
  556. ----
  557. // TESTRESPONSE[s/"took": 20/"took": $body.took/]
  558. // TESTRESPONSE[s/"max_score": 0.2876821/"max_score": $body.hits.max_score/]
  559. // TESTRESPONSE[s/"_score": 0.2876821/"_score": $body.hits.hits.0._score/]
  560. <1> Backing index containing the matching document
  561. <2> Document ID for the document
  562. <3> Current sequence number for the document
  563. <4> Primary term for the document
  564. You can use an <<docs-index_,index API>> request to update an individual
  565. document. To prevent an accidental overwrite, this request must include valid
  566. `if_seq_no` and `if_primary_term` arguments.
  567. The following index API request updates an existing document in the `logs` data
  568. stream. The request targets document ID `bfspvnIBr7VVZlfp2lqX` in the
  569. `.ds-logs-000003` backing index.
  570. The request also includes the current sequence number and primary term in the
  571. respective `if_seq_no` and `if_primary_term` query parameters. The request body
  572. contains a new JSON source for the document.
  573. [source,console]
  574. ----
  575. PUT /.ds-logs-000003/_doc/bfspvnIBr7VVZlfp2lqX?if_seq_no=0&if_primary_term=1
  576. {
  577. "@timestamp": "2020-12-07T11:06:07.000Z",
  578. "user": {
  579. "id": "8a4f500d"
  580. },
  581. "message": "Login successful"
  582. }
  583. ----
  584. You use the <<docs-delete,delete API>> to delete individual documents. Deletion
  585. requests do not require a sequence number or primary term.
  586. The following index API request deletes an existing document in the `logs` data
  587. stream. The request targets document ID `bfspvnIBr7VVZlfp2lqX` in the
  588. `.ds-logs-000003` backing index.
  589. [source,console]
  590. ----
  591. DELETE /.ds-logs-000003/_doc/bfspvnIBr7VVZlfp2lqX
  592. ----
  593. You can use the <<docs-bulk,bulk API>> to delete or update multiple documents in
  594. one request using `delete`, `index`, or `update` actions.
  595. If the action type is `index`, the action must include valid
  596. <<bulk-optimistic-concurrency-control,`if_seq_no` and `if_primary_term`>>
  597. arguments.
  598. The following bulk API request uses an `index` action to update an existing
  599. document in the `logs` data stream.
  600. The `index` action targets document ID `bfspvnIBr7VVZlfp2lqX` in the
  601. `.ds-logs-000003` backing index. The action also includes the current sequence
  602. number and primary term in the respective `if_seq_no` and `if_primary_term`
  603. parameters.
  604. [source,console]
  605. ----
  606. PUT /_bulk?refresh
  607. { "index": { "_index": ".ds-logs-000003", "_id": "bfspvnIBr7VVZlfp2lqX", "if_seq_no": 0, "if_primary_term": 1 } }
  608. { "@timestamp": "2020-12-07T11:06:07.000Z", "user": { "id": "8a4f500d" }, "message": "Login successful" }
  609. ----