# How To filter & count documents and show data table?

**URL:** <https://discuss.elastic.co/t/how-to-filter-count-documents-and-show-data-table/182830>\
**Category:** Kibana\
**Created:** [May 27, 2019, 4:10am UTC](https://discuss.elastic.co/t/how-to-filter-count-documents-and-show-data-table/182830 "2019-05-27T04:10:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ma34-i](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@ma34-i](https://discuss.elastic.co/u/ma34-i)\
**Post date:** [May 27, 2019, 4:10am UTC](https://discuss.elastic.co/t/how-to-filter-count-documents-and-show-data-table/182830/1 "2019-05-27T04:10:19Z")

</div>

## Data

I have these kind of data.(And I have converted csv to json and POSTed to ElasticSearch.)

```auto
# csv
          timestamp, name, value1, value2
2019-05-27T00:00:00, "NAME_1", 0, 2.30
2019-05-27T00:00:00, "NAME_2", 1, 4.78
2019-05-27T00:10:00, "NAME_1", 0, 3.92
....

# json
{[
    {
        "timestamp": "2019-05-27T00:00:00",
        "name": "NAME_1",
        "value1": 0,
        "value2": 2.30
    },
    {
        ...
    }
]}

```

## Expectation

I want to visualize these data as "Data Table" on Kibana.  
How I should write JSON input?

(I cannot find related examples for independent filtering.)

```auto
| name | Count(value1>=3) | Count(value2>=5.0) |
| -------- | ---------------- | ------------------ |
| "NAME_1" | 10 | 360 |
| "NAME_2" | 123 | 600 |

```

### etc

- Elasticsearch & Kibana Version = 6.7.1

---

<div class="post-metadata">

**Author:** ![christophilus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christophilus/32/42991_2.png) [@christophilus](https://discuss.elastic.co/u/christophilus)\
**Post date:** [June 4, 2019, 5:23pm UTC](https://discuss.elastic.co/t/how-to-filter-count-documents-and-show-data-table/182830/2 "2019-06-04T17:23:38Z")

</div>

You'll want to post each record as its own document, most likely. Here's an example using the Kibana Dev Tools, but you can do this in many ways.

```auto
POST myindex/_doc
{
    "timestamp": "2019-05-27T00:00:00",
    "name": "NAME_2",
    "value1": 0,
    "value2": 2.30
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 2, 2019, 5:23pm UTC](https://discuss.elastic.co/t/how-to-filter-count-documents-and-show-data-table/182830/3 "2019-07-02T17:23:43Z")

</div>

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