Skip to content

Commit

Permalink
Adds example for how to change a field format (#132541) (#132569)
Browse files Browse the repository at this point in the history
(cherry picked from commit cadd7b3)

Co-authored-by: Kaarina Tungseth <kaarina.tungseth@elastic.co>
  • Loading branch information
kibanamachine and KOTungseth authored May 19, 2022
1 parent 6aa0456 commit 02058da
Showing 1 changed file with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion docs/api/data-views/update-fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,53 @@ $ curl -X POST api/data_views/data-view/my-view/fields
--------------------------------------------------
// KIBANA

Change a simple field format:

[source,sh]
--------------------------------------------------
$ curl -X POST api/data_views/data-view/my-view/fields
{
"fields": {
"foo": {
"format": {
"id": "bytes"
}
}
}
}
--------------------------------------------------
// KIBANA

Change a complex field format:

[source,sh]
--------------------------------------------------
$ curl -X POST api/data_views/data-view/my-view/fields
{
"fields": {
"foo": {
"format": {
"id": "static_lookup",
"params": {
"lookupEntries": [
{
"key": "1",
"value": "100"
},
{
"key": "2",
"value": "200"
}
],
"unknownKeyValue": "5000"
}
}
}
}
}
--------------------------------------------------
// KIBANA

Update multiple metadata fields in one request:

[source,sh]
Expand All @@ -80,6 +127,7 @@ $ curl -X POST api/data_views/data-view/my-view/fields
// KIBANA

Use `null` value to delete metadata:

[source,sh]
--------------------------------------------------
$ curl -X POST api/data_views/data-view/my-pattern/fields
Expand All @@ -93,8 +141,8 @@ $ curl -X POST api/data_views/data-view/my-pattern/fields
--------------------------------------------------
// KIBANA


The endpoint returns the updated data view object:

[source,sh]
--------------------------------------------------
{
Expand Down

0 comments on commit 02058da

Please sign in to comment.