# How to get array value in opensearch dashboard

**URL:** <https://forum.opensearch.org/t/how-to-get-array-value-in-opensearch-dashboard/13722>\
**Category:** OpenSearch Dashboards\
**Created:** [March 31, 2023, 10:31am UTC](https://forum.opensearch.org/t/how-to-get-array-value-in-opensearch-dashboard/13722 "2023-03-31T10:31:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Upendar](https://avatars.discourse-cdn.com/v4/letter/u/f475e1/32.png) [@Upendar](https://forum.opensearch.org/u/Upendar)\
**Post date:** [March 31, 2023, 10:31am UTC](https://forum.opensearch.org/t/how-to-get-array-value-in-opensearch-dashboard/13722/1 "2023-03-31T10:31:33Z")

</div>

Hi,  
We are using opensearch dashboards with the version of 2.3.0.  
We can see there are different values for the field “partition” for the “XYZ” operation logs (logtype is same and operation is same).  
loglines are:  
(1). 2023-01-05T20:46:21.36348538Z stdout F 2023-01-05 20:46:21.363 [INFO] - {“logtype”:“ABC”,“operation”:“XYZ”,“partition”:,“topic”:“INT\_XXXX\_TD”}

(2). 2023-01-05T20:38:26.998223061Z stdout F 2023-01-05 20:38:26.998 [INFO] - {“logtype”:“ABC”,“operation”:“XYZ”,“partition”:[{“Topic”:“INT\_XXXX\_RETRY”,“Partition”:1,“Offset”:-1111,“Metadata”:null,“Error”:null},{“Topic”:“INT\_XXXX\_RETRY”,“Partition”:0,“Offset”:-1111,“Metadata”:null,“Error”:null}],“topic”:“INT\_XXXX\_RETRY”}

(3) 2023-01-05T20:46:21.36312474Z stdout F 2023-01-05 20:46:21.362 [INFO] - {“logtype”:“ABC”,“operation”:“XYZ”,“partition”:[{“Topic”:“INT\_XXXX\_TD”,“Partition”:0,“Offset”:-1111,“Metadata”:null,“Error”:null}],“topic”:“INT\_XXXX\_TD”}

In above 2 logs the “partition” value is not constant some times it is “null” and sometimes it is “Array”. I need to drop “partition” value is “null” logs and only i need to get remaining logs (i.e log number 2 &3).Could you please guide me how to get “partition” as a field in kibana and which condition i need to mentioned in logstash config.

Configuration in Logstash:-

if(“assigned-partition” in [kafka][operation] or “revoked-partition” in [kafka][operation])  
{  
mutate {  
rename =\> [“[kafka][topic]”, “[kafka][topic][name]” ]  
add\_field =\> { “[kafka][messagetype]” =\> “consumerEvents” }

---

<div class="post-metadata">

**Author:** ![gaobinlong](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/gaobinlong/32/5242_2.png) [@gaobinlong](https://forum.opensearch.org/u/gaobinlong)\
**Post date:** [April 3, 2023, 3:53am UTC](https://forum.opensearch.org/t/how-to-get-array-value-in-opensearch-dashboard/13722/2 "2023-04-03T03:53:35Z")

</div>

You can use `exists query` to get the array value, like this:

```auto
GET test1/_search
{
  "query": {
    "exists": {
      "field": "partition"
    }
  }
}

```

,and use [drop filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-drop.html) in Logstash to drop the log whose `partition` field is `null`.
