Kibana 5.4.0 - Vertical Bar Data Visualization Issue


(Zamir Arif) #1

I am able to create index and in discovery tab all the data is being populated shown properly.

{
  "_index": "deal-expense",
  "_type": "kafka-connect",
  "_id": "deal-expense+0+63",
  "_version": 2,
  "_score": 1,
  "_source": {
    "EXPENSE_CODE": "NL**20",
    "EXPENSE_CODE_DESCRIPTION": "DO NOT USE ****** ****** - ADAM",
    "NO_OF_DEALS": 17
  }
}

Data Visualization Requirement:

There might be multiple indexed documents for every EXPENSE_CODE

On Y Axis I need to display Max Of NO_OF_DEALS and On X Axis I need to display EXPENSE_CODE

Max Of NO_OF_DEALS are not being populated but EXPENSE_CODE is being populated.


(Tyler Smalley) #2

This worked for me, I wonder if it's related to your index mappings.

Here is my setup:

DELETE discuss-134450

PUT /discuss-134450
{
  "mappings": {
    "_doc": {
      "properties": {
        "geo": {
          "properties": {
            "EXPENSE_CODE": {
              "type": "keyword"
            },
            "NO_OF_DEALS": {
              "type": "integer"
            }
          }
        }
      }
    }
  }
}

POST discuss-134450/_doc
{
  "EXPENSE_CODE": "TEST1",
  "NO_OF_DEALS": 1
}
POST discuss-134450/_doc
{
  "EXPENSE_CODE": "TEST1",
  "NO_OF_DEALS": 1
}
POST discuss-134450/_doc
{
  "EXPENSE_CODE": "TEST1",
  "NO_OF_DEALS": 1
}

POST discuss-134450/_doc
{
  "EXPENSE_CODE": "TEST2",
  "NO_OF_DEALS": 20
}

POST discuss-134450/_doc
{
  "EXPENSE_CODE": "TEST3",
  "NO_OF_DEALS": 50
}
POST discuss-134450/_doc
{
  "EXPENSE_CODE": "TEST3",
  "NO_OF_DEALS": 1
}

Can you post your mappings for this index?

Here is an example from DevTools: GET discuss-134450/_mapping


(Zamir Arif) #3

Thanks for the quick response.

Kibana is creating the index.

 {
"_index": ".kibana",
"_type": "index-pattern",
"_id": "deal-exp*",
"_score": 1,
"_source": {
	"title": "deal-exp*",
	"fields": """[
				{
					"name": "expense_code_description.keyword",
					"type": "string",
					"count": 0,
					"scripted": false,
					"indexed": true,
					"analyzed": false,
					"doc_values": true,
					"searchable": true,
					"aggregatable": true
				},{
					"name": "nr_of_deal.keyword",
					"type": "string",
					"count": 0,
					"scripted": false,
					"indexed": true,
					"analyzed": false,
					"doc_values": true,
					"searchable": true,
					"aggregatable": true
				},{
					"name": "expense_code",
					"type": "string",
					"count": 0,
					"scripted": false,
					"indexed": true,
					"analyzed": true,
					"doc_values": false,
					"searchable": true,
					"aggregatable": false
				},{
					"name": "expense_code.keyword",
					"type": "string",
					"count": 0,
					"scripted": false,
					"indexed": true,
					"analyzed": false,
					"doc_values": true,
					"searchable": true,
					"aggregatable": true
				},{
					"name": "expense_code_description",
					"type": "string",
					"count": 0,
					"scripted": false,
					"indexed": true,
					"analyzed": true,
					"doc_values": false,
					"searchable": true,
					"aggregatable": false
				},{
					"name": "_source",
					"type": "_source",
					"count": 0,
					"scripted": false,
					"indexed": false,
					"analyzed": false,
					"doc_values": false,
					"searchable": false,
					"aggregatable": false
				},{
					"name": "nr_of_deal",
					"type": "string",
					"count": 0,
					"scripted": false,
					"indexed": true,
					"analyzed": true,
					"doc_values": false,
					"searchable": true,
					"aggregatable": false
				},{
					"name": "EXPENSE_CODE_DESCRIPTION",
					"type": "string",
					"count": 0,
					"scripted": false,
					"indexed": true,
					"analyzed": true,
					"doc_values": false,
					"searchable": true,
					"aggregatable": false
				},{
					"name": "EXPENSE_CODE",
					"type": "string",
					"count": 1,
					"scripted": false,
					"indexed": true,
					"analyzed": true,
					"doc_values": false,
					"searchable": true,
					"aggregatable": false
				},{
					"name": "NO_OF_DEALS",
					"type": "number",
					"count": 1,
					"scripted": false,
					"indexed": true,
					"analyzed": false,
					"doc_values": true,
					"searchable": true,
					"aggregatable": true
				},{
					"name": "_id",
					"type": "string",
					"count": 0,
					"scripted": false,
					"indexed": false,
					"analyzed": false,
					"doc_values": false,
					"searchable": false,
					"aggregatable": false
				},{
					"name": "_type",
					"type": "string",
					"count": 0,
					"scripted": false,
					"indexed": false,
					"analyzed": false,
					"doc_values": false,
					"searchable": true,
					"aggregatable": true
				},{
					"name": "_index",
					"type": "string",
					"count": 0,
					"scripted": false,
					"indexed": false,
					"analyzed": false,
					"doc_values": false,
					"searchable": false,
					"aggregatable": false
				},{
					"name": "_score",
					"type": "number",
					"count": 0,
					"scripted": false,
					"indexed": false,
					"analyzed": false,
					"doc_values": false,
					"searchable": false,
					"aggregatable": false
				}
	]"""
}

}


(Zamir Arif) #4

@tylersmalley I used the index you shared and mapped with my original index and it works.

POST _reindex
{
  "source": {
    "index": "deal-expense"
  },
  "dest": {
    "index": "discuss-134450"
  }
} 

By default when you add index to kibana it creates the number fields and keywords fields.

My questions are

why do I need to reindex the fields in this case?

When data will be added to original index then it will update the data with re-indexed indices?


(system) #5

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