Creating a Vertical bar from json

Hi -

I want to create a Vertical bar depicting count on Y-axis and State/status of files in X-axis. Hovering/Drilling down/Clicking on each bar should show files names. The state of files would be updated every hour.

I have created the below json format to visualize the state of file, (we can modify json schema or add additional jsons):

{
    "finaljson": [
        {
            "status": "stage1",
            "feeds": [
                "file1"
            ],
            "count": 1
        },
        {
            "status": "stage2",
            "feeds": [
                "file2",
                "file3",
                "file4",
                "file8"
            ],
            "count": 4
        },
        {
            "status": "stage3",
            "feeds": [],
            "count": 0
        },
        {
            "status": "stage4",
            "feeds": [
                "file5",
                "file6",
                "file7",
                "file9",
                "file10"
            ],
            "count": 5
        },
        {
            "status": "stage5",
            "feeds": [
                "file11",
                "file12,
            ],
            "count": 2
        }
    ]
}

We are using Version: 6.4.2, I am unable to create the required visualization, any guidance would help.

Thanks,

Hey @aayushg, you'll first want to get your documents into Elasticsearch. I'd highly recommend inserting a document per file, and allowing Elasticsearch to perform the aggregation for you. The following can be used in DevTools to bulk-import the data-set which you've described:

POST aayushg/_bulk
{ "index": {} }
{ "feed": "file1", "status": "stage1"}
{ "index": {} }
{ "feed": "file2", "status": "stage2"}
{ "index": {} }
{ "feed": "file3", "status": "stage2"}
{ "index": {} }
{ "feed": "file4", "status": "stage2"}
{ "index": {} }
{ "feed": "file5", "status": "stage2"}
{ "index": {} }
{ "feed": "file6", "status": "stage4"}
{ "index": {} }
{ "feed": "file7", "status": "stage4"}
{ "index": {} }
{ "feed": "file9", "status": "stage4"}
{ "index": {} }
{ "feed": "file10", "status": "stage4"}
{ "index": {} }
{ "feed": "file11", "status": "stage5"}
{ "index": {} }
{ "feed": "file12", "status": "stage5"}

You'll then have to create an index-pattern in Kibana, so we can create a Visualization against this data. To do so, go to Management -> Index Patterns -> Create Index Pattern. Enter in the index pattern "aayushg", click Next and then Create Index Pattern.

Now we can create the Visualization! Go to Visualize -> Create New Visualization -> Vertical Bar Chart -> Select the aayushg index pattern. Click the plus sign under buckets -> X-axis -> Terms Aggregation on status.keyword. Save this visualization as "Stages".

The visualization will allow you to see the aggregate information, but it won't allow you to easily see the individual files. To accomplish this, we're going to create a separate "Saved Search" which shows the individual files, and add both of them to a Dashboard.

Click on Discover -> Select the Feed field and Save this as "Feeds"

Click on Dashboard -> Create New Dashboard -> Add -> Select the "Feeds" and "Stages" to add them to the Dashboard. Now when you click on one of the Stages bars, it'll filter the Feeds:

Awesome. Thanks much!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.