Plachey
(Plachey)
April 11, 2022, 1:46pm
1
Hello
Who can help me with index color format request
I found this api /api/saved_objects/index-pattern/xxxxx/fields
but i got problem with data for it request, I can't find how to do it (format and naming fields)
my data:
"fields": {
"log": {
"format": "color",
'pattern'
}
}
})
Need like on screenshot
mattkime
(Matthew Kime)
April 11, 2022, 8:44pm
2
Hello @Plachey - Which version of the elastic stack are you running?
Plachey
(Plachey)
April 12, 2022, 3:55am
4
Hello. I used docker image Elasticsearch 7.10.2. kibana 7.10.1
mattkime
(Matthew Kime)
April 12, 2022, 4:15am
5
The formatter settings vary in how they're saved. The best way to learn how they work is to use the UI to create the desired effect and then export the relevant index pattern saved object.
Plachey
(Plachey)
April 12, 2022, 4:31am
6
Yes, I did it in ui, in screenshot and it work for me. Buti can't do the same using API request. If export help me, could you please send me example
mattkime
(Matthew Kime)
April 12, 2022, 1:31pm
7
Have you looked at Stack Management > Saved Objects ? Saved Objects | Kibana Guide [8.1] | Elastic
Plachey
(Plachey)
April 12, 2022, 4:40pm
8
Yes i found it
"fieldFormatMap": {
"log": {
"id": "color",
"params":
{
"parsedUrl":
{
"origin":"http://localhost:5601",
"pathname":"/app/management/kibana/indexPatterns",
"basePath":""
},
"fieldType": "string",
"colors":
[{"range": "-Infinity:Infinity",
"regex": ".+(sERRORs).+",
"text": "#FF0000",
"background": "#ffffff"
},
{"range": "-Infinity:Infinity",
"regex": ".+(sWARNINGs).+",
"text": "#E3C330",
"background": "#ffffff"}
]}
}
}
}
but it don't work with api
..../api/saved_objects/index-pattern/my_ndex-pattern'
I can't even change title
mattkime
(Matthew Kime)
April 12, 2022, 6:52pm
9
Here are the docs for that api - Update object API | Kibana Guide [7.10] | Elastic
The error is stating that it doesn't see an 'attributes' property
Plachey
(Plachey)
April 12, 2022, 7:19pm
10
So to update fieldFormatMap
I need update kibana to 8 version?
mattkime
(Matthew Kime)
April 12, 2022, 8:08pm
11
No, you need to change the payload of the request
Plachey
(Plachey)
April 13, 2022, 8:24am
12
i try it but after that i opened my created idex-patter and see blank white page
Plachey
(Plachey)
April 13, 2022, 3:58pm
13
Thank you very much. I did it
system
(system)
Closed
May 11, 2022, 3:58pm
14
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.