I have a bunch of documents with the attribute status, which can be an integer from 0 to 5. I now want in the visualisation instead of the numbers 0 to 5 strings for these, like 0 = New, 1 = edited, etc. I don't really know how I can achieve this. The only way I'm comming up with is to hook up a tiny webserver which does the magic. Any help how I can manage this without a webserver is apprechiated.
You can create a scripted field to do this:
- Click Management
- Click Index Patterns
- Click the desired index pattern
- Click Scripted Fields
- Click Add Scripted Field
- Choose a name for the field, e.g. status_string
- Select string as the type
- In the script, type something like the following:
def status = doc['status'].value;
if (status == 0) return 'New';
if (status == 1) return 'edited';
Save the scripted field, and you should see it everywhere in Kibana!
Thanks, that works just fine.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.