Data mapping is not correct in Kibana data table

Hi Elastic community,

I am newbie .
I have written code that provide this information,


In Discover you can see the data received correct as code

Incorrect Data mapping as shown in kibana data table:

Data is not correct mapping in Elastic kibana, how can i correct map the data in data table?
like
device ID : signal strength : last date
311c : 42 : 14-02-2023
3181 :45 : 15:02-2023

correct date and signal strength value along with its device iD

Welcome to our community! :smiley:
Please don't post pictures of text, logs or code. They are difficult to read, impossible to search and replicate (if it's code), and some people may not be even able to see them.

Can you share the _mapping for the index?

Thank you for your response. I will avoid next time to share the images.
but sorry I am not getting your point.
what is _mapping for index?

I mean GET health_sdm_powerdoff/_mapping.

Thank you for your response. Here is the _mapping for the index.

{
"health_sdm_poweredoff" : {
"mappings" : {
"properties" : {
"Customer" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"Data" : {
"properties" : {
"UpTime" : {
"type" : "date"
},
"count_Poweredoff_devices" : {
"type" : "long"
},
"status_Poweredoff_devices" : {
"properties" : {
"Device_ID" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"Time_created" : {
"type" : "date"
},
"signal_strength" : {
"type" : "long"
}
}
}
}
},
"Version" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"hostname" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
}
}

Hi @Tanzeela! Happy to help you, but I have a couple of questions about your data.

Based on your mappings, it looks like you're storing information about multiple devices in a single array in a single document, is that right?

What does each document in your index represent? Are they each a specific point in time? Is there any reason you aren't storing each device as a separate document?

Hi @Andrew_Tate . Thanks for helping me in this issue. initially i have stored this array in a single document. but now i have resolved this issue by storing the device as a separate documents.

but i just want to know that is there any possibility we can correct data mapping on table by single document?

@Tanzeela glad to hear that resolved your issue.

is there any possibility we can correct data mapping on table by single document?

No, not that I know of. You really have two options.

If you want to display a table that includes aggregations over multiple documents (e.g. average, max, percentile) you can use a Lens table.

If you want a table that shows fields from each document on a single row, you can embed a saved search from Discover.

Here's a screenshot of the two side-by-side:

If you have a use case for generating a table from an array on a single document, it would be interesting to hear it. But, these two approaches are basically what we cover in Kibana.

Hi @Andrew_Tate Thank you so much for your response. Both are interesting approaches. Before that, I had only used Discover. but I haven't used the saved search from Discover.

Hi @Andrew_Tate Can you please help me with another issue related to Kibana? Can we make a visualisation, unique count metric, and table of those documents whose data we haven't received from 7 days. Any idea how we can do this task

Hi @Tanzeela , happy to discuss this. Would you mind opening a new topic with the specifics? That will make it easier for other community members to locate our discussion in the future.

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