{"id":14236003,"url":"https://github.com/istresearch/kibana-object-format","last_synced_at":"2025-04-24T02:44:23.855Z","repository":{"id":53132542,"uuid":"87837231","full_name":"istresearch/kibana-object-format","owner":"istresearch","description":"A Kibana plugin for displaying objects and arrays of objects.","archived":false,"fork":false,"pushed_at":"2021-05-10T13:45:23.000Z","size":4329,"stargazers_count":96,"open_issues_count":0,"forks_count":26,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-04-18T10:24:02.901Z","etag":null,"topics":["array","formatter","kibana","object","plugin","visualization"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/istresearch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-10T17:14:38.000Z","updated_at":"2024-11-26T09:24:22.000Z","dependencies_parsed_at":"2022-09-12T01:00:27.917Z","dependency_job_id":null,"html_url":"https://github.com/istresearch/kibana-object-format","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/istresearch%2Fkibana-object-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/istresearch%2Fkibana-object-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/istresearch%2Fkibana-object-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/istresearch%2Fkibana-object-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/istresearch","download_url":"https://codeload.github.com/istresearch/kibana-object-format/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250551420,"owners_count":21449158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","formatter","kibana","object","plugin","visualization"],"created_at":"2024-08-20T21:02:39.243Z","updated_at":"2025-04-24T02:44:23.834Z","avatar_url":"https://github.com/istresearch.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"**Starting with Kibana 7.12, the multi-fields and list of objects are now displayed and filterable by Kibana itself without the use if this plugin. Development of this project has ceased and we will not be maintaining it going forward.** Here is one of several PRs introducing the changes making this plugin obsolete: https://github.com/elastic/kibana/issues/77107.\n\n# kibana_object_format\n\nThis Kibana plugin enables you to configure field formatters for arrays of objects in the Discover tab and Search tables in dashboards.\n\n![Screenshot](images/demo.gif)\n\n---\n\n## Features\n\n - Kibana 7.x compatible\n - Enables field formatting for objects and arrays of objects\n - Includes a general purpose Object field formatter to fit most needs with:\n    - Hit highlighting\n    - Cell click filtering\n    - Support for Text, Hyperlinks, and Images\n\n## How it works\n\nKibana has long needed a good way to display arrays of objects in the discover tab. What you get from Kibana is a json string representation of the data and a warning icon stating that, \"Objects in arrays are not well supported\". The reason for this is that Elasticsearch doesn't care or store in the index mapping that your field is an array of objects. The index mapping is a flattened view of the data. \n\n\u003cimg src=\"images/not_supported.jpg\"\u003e\n\nLooking at the fields list on the Index Patterns tab reveals this as well. You will find entries for all of the concrete values of your object, but nothing for the containing object. This plugin allows you to create synthetic entries in the fields list. Once an entry for the path you want to display is available in the list, you can apply any field formatter to it, and the Discover table will use that to display the value. \n\n## Instructions\n\n 1. Install the plugin following Kibana's [official documentation](https://www.elastic.co/guide/en/kibana/6.x/install-plugin.html).\n\n 2. Configure the index pattern to include the additional field(s).\n \n    The plugin adds a new property to the *Advanced Settings* table named **fieldMapperHack:fields**. The value is a JSON object which defines include and exclude lists per index pattern. The include and exclude lists values can be regular expressions, and are applied include first then excludes second.\n    \n    If the index pattern key is named '__\\*__', this entry will be used as the default for all index patterns that a specific entry is not defined. In the example JSON below, all index patterns are ignored except for one named *my_index_pattern*. For this index pattern we inject a field entry into the list for the field located at *my.field*.\n    \n**_The ID of the index pattern must be used in the configuration, not the display name._**\n\n ```json\n    {\n        \"index_pattern\":{\n            \"*\":{\n                \"include\":[\n    \n                ],\n                \"exclude\":[\n                    \".*\"\n                ]\n            },\n            \"my_index_pattern\":{\n                \"include\":[\n                    \"my.field\"\n                ]\n            }\n        }\n    }\n ```\n\n 3. Refresh the fields list for your index pattern.\n    \n    \u003cimg src=\"images/refresh.jpg\"\u003e\n\n 4. Select a field formatter for the new field entry!\n\n## Examples\n\n#### Formatting a Basic Object\n\nData Sample:\n\n```json\n{\n  \"book\": {\n    \"author\": \"John Jenkins\",\n    \"title\": \"Building Code\"\n  }\n}\n```\nIndex Mapping:\n```json\n{\n  \"my_index\": {\n    \"mappings\": {\n      \"doc\": {\n        \"properties\": {\n          \"book\": {\n            \"properties\": {\n              \"author\": {\n                \"type\": \"text\",\n                \"fields\": {\n                  \"keyword\": {\n                    \"type\": \"keyword\",\n                    \"ignore_above\": 256\n                  }\n                }\n              },\n              \"title\": {\n                \"type\": \"text\",\n                \"fields\": {\n                  \"keyword\": {\n                    \"type\": \"keyword\",\n                    \"ignore_above\": 256\n                  }\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nIndexing the above document into an index named *my_index* will yield the following in the discover tab.\n\n\u003cimg src=\"images/basic_native.jpg\"\u003e\n\nAs a trivial example, we can display the whole _book_ object as a single item in the discover tab and choose which of it's fields to include. To do this, we must inject a field into the fields list by editing the **fieldMapperHack:fields** advanced configuration to include our index mapping and field, as seen below.\n\n```json\n{\n   \"index_pattern\":{\n      \"*\":{\n         \"include\":[\n\n         ],\n         \"exclude\":[\n            \".*\"\n         ]\n      },\n      \"my_index\":{\n         \"include\":[\n            \"book\"\n         ]\n      }\n   }\n}\n```\nNext we must *Refresh* the field list for the index pattern. This will add a new field entry for the *book* object. Because of this new field, the Discover tab will change the presentation from the two previous fields and only show the book field as a json object.\n\n\u003cimg src=\"images/basic_raw.jpg\"\u003e\n\nSeeing the *book* object as JSON in the Discover tab is not exactly a desirable result. But it demonstrates the basic behavior this plugin leverages to synthesize field entries so that we can apply a field formatter. \n\nLets return to the fields list for our *my_index* index pattern and apply the *Object* field formatter to it. Then lets configure the formatter so that we get a nice non-json view of the object.\n\n\u003cimg src=\"images/basic_format.jpg\"\u003e\n\nNow let's go back to the Discover tab and see the results.\n\n\u003cimg src=\"images/basic_formatted.jpg\"\u003e\n\nThe usefulness of this particular example is likely low, beyond demonstrating the basic steps of configuration. Next let's look at a more advanced scenario.\n\n#### Formatting an Array of Objects\n\nData Sample:\n```json\n{\n   \"new_releases\":[\n      {\n         \"author\":\"Yoon Ha Lee\",\n         \"title\":\"Raven Stratagem\",\n         \"cover_art\":\"https://images-na.ssl-images-amazon.com/images/I/51jo1k%2BX00L._SY160_.jpg\"\n      },\n      {\n         \"author\":\"Cixin Liu, Ken Liu\",\n         \"title\":\"The Three-Body Problem\",\n         \"cover_art\":\"https://images-na.ssl-images-amazon.com/images/I/51ZEDZNEs1L._SY160_.jpg\"\n      },\n      {\n         \"author\":\"Rachel Caine\",\n         \"title\":\"Stillhouse Lake\",\n         \"cover_art\":\"https://images-na.ssl-images-amazon.com/images/I/41leYSjxbyL._SY160_.jpg\"\n      }\n   ]\n}\n```\n\nIndex Mapping:\n```json\n{\n  \"my_index\": {\n    \"mappings\": {\n      \"doc\": {\n        \"properties\": {\n          \"new_releases\": {\n            \"properties\": {\n              \"author\": {\n                \"type\": \"text\",\n                \"fields\": {\n                  \"keyword\": {\n                    \"type\": \"keyword\",\n                    \"ignore_above\": 256\n                  }\n                }\n              },\n              \"cover_art\": {\n                \"type\": \"text\",\n                \"fields\": {\n                  \"keyword\": {\n                    \"type\": \"keyword\",\n                    \"ignore_above\": 256\n                  }\n                }\n              },\n              \"title\": {\n                \"type\": \"text\",\n                \"fields\": {\n                  \"keyword\": {\n                    \"type\": \"keyword\",\n                    \"ignore_above\": 256\n                  }\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nIndexing the above document into an index named *my_index* will yield the following in the discover tab.\n\n\u003cimg src=\"images/array_native.jpg\"\u003e\n\nNow edit the **fieldMapperHack:fields** advanced configuration:\n\n```json\n{\n   \"index_pattern\":{\n      \"*\":{\n         \"include\":[\n\n         ],\n         \"exclude\":[\n            \".*\"\n         ]\n      },\n      \"my_index\":{\n         \"include\":[\n            \"new_releases\"\n         ]\n      }\n   }\n}\n```\n\nNext we must *Refresh* the field list for the index pattern, and apply the *Object* field formatter to new *new_releases* field.\n\n\u003cimg src=\"images/array_format.jpg\"\u003e\n\nNow let's go back to the Discover tab and see the results.\n\n\u003cimg src=\"images/array_formatted.jpg\"\u003e\n\n---\n\n## development\n\nSee the [kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) for instructions setting up your development environment. Once you have completed that, use the following yarn scripts.\n\n  - `yarn kbn bootstrap`\n\n    Install dependencies and crosslink Kibana and all projects/plugins.\n\n    \u003e ***IMPORTANT:*** Use this script instead of `yarn` to install dependencies when switching branches, and re-run it whenever your dependencies change.\n\n  - `yarn start`\n\n    Start kibana and have it include this plugin. You can pass any arguments that you would normally send to `bin/kibana`\n\n      ```\n      yarn start --elasticsearch.hosts http://localhost:9220\n      ```\n\n  - `yarn build`\n\n    Build a distributable archive of your plugin.\n\n  - `yarn test:browser`\n\n    Run the browser tests in a real web browser.\n\n  - `yarn test:mocha`\n\n    Run the server tests using mocha.\n\nFor more information about any of these commands run `yarn ${task} --help`. For a full list of tasks checkout the `package.json` file, or run `yarn run`.\n\nplugins/kibana-object-format/public/hacks/object_filter_hack.js\nREMOVE plugins/kibana-object-format/public/common/clean-template\nplugins/kibana-object-format/public/field_formats/object/cleanFieldTemplate.js\nplugins/kibana-object-format/package.json\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fistresearch%2Fkibana-object-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fistresearch%2Fkibana-object-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fistresearch%2Fkibana-object-format/lists"}