# Filebeat+csv - to many fields indexed

**URL:** <https://discuss.elastic.co/t/filebeat-csv-to-many-fields-indexed/185594>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [June 13, 2019, 9:26am UTC](https://discuss.elastic.co/t/filebeat-csv-to-many-fields-indexed/185594 "2019-06-13T09:26:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![urosz](https://avatars.discourse-cdn.com/v4/letter/u/bb73d2/32.png) [@urosz](https://discuss.elastic.co/u/urosz)\
**Post date:** [June 13, 2019, 9:26am UTC](https://discuss.elastic.co/t/filebeat-csv-to-many-fields-indexed/185594/1 "2019-06-13T09:26:14Z")

</div>

Hi,  
I've created a flow  
filebeat (\*.csv) -\> elasticseach cloud -\> kibana

```
Ingest pipe:
    PUT _ingest/pipeline/stat_csv_parser
    {
      "description" : "CSV Parser",
      "processors" : [
        {
          "grok": {
            "field": "message",
            "patterns": ["%{NUMBER:eventId},%{DATA:contentName},%{NUMBER:time},%{NUMBER:duration}"],
            "ignore_missing": true
          }
        },
        {
          "date":{
            "field":"time",
            "formats": ["UNIX"]
          }
        }
      ],
      "on_failure" : [
        {
          "set" : {
            "field" : "error",
            "value" : " - Error processing message - "
          }
        }
      ]
    }

```

CSV data is in a form:

```
1,movie2,1560411512478,120
1,movie1,1560411513234,10

```

My problem is that in addition to 4 fields, i get aprox 33 fields in my index.  
I didn't touch fields.yml  
Do I have to define my own fields.yml to have a clean index fields list?

This is my filebeat.yml:

```
filebeat.inputs:
  - type: log
    enabled: true
    paths:
      - /var/log/stat/*.csv

setup.template:
  enabled: true
  name: "myIndex"
  pattern: "myIndex-*"
  overwrite: true

cloud.id: "xxxxxxxxxxxxxxxxx"
cloud.auth: "elastic:xxxxxxxxxxxxxxxxx"
output.elasticsearch:
  enabled: true
  index: "myIndex-%{[agent.version]}-%{+yyyy.MM.dd}"
  pipeline: "stat_csv_parser"
  indices:
    - index: "myIndex"
      mappings:
      default: "myIndex"

```

What would is the best approach to ingest csv from the upper sample?  
Thank you in advance!

---

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [June 14, 2019, 6:48pm UTC](https://discuss.elastic.co/t/filebeat-csv-to-many-fields-indexed/185594/2 "2019-06-14T18:48:33Z")

</div>

What are the other 33 fields you are seeing in your index?

Shaunak

---

<div class="post-metadata">

**Author:** ![urosz](https://avatars.discourse-cdn.com/v4/letter/u/bb73d2/32.png) [@urosz](https://discuss.elastic.co/u/urosz)\
**Post date:** [June 17, 2019, 7:13am UTC](https://discuss.elastic.co/t/filebeat-csv-to-many-fields-indexed/185594/3 "2019-06-17T07:13:38Z")

</div>

This is the first screen of Kibana index:

 ![fields](https://us1.discourse-cdn.com/elastic/original/3X/e/b/eb55c0a79689608f31852e7598ca4d7fd65e8c7c.png)

And one more:

 ![fields](https://us1.discourse-cdn.com/elastic/original/3X/f/4/f4336ac83c22453732f45d6a229f95ac58836ce4.png)

---

<div class="post-metadata">

**Author:** ![urosz](https://avatars.discourse-cdn.com/v4/letter/u/bb73d2/32.png) [@urosz](https://discuss.elastic.co/u/urosz)\
**Post date:** [June 17, 2019, 8:01am UTC](https://discuss.elastic.co/t/filebeat-csv-to-many-fields-indexed/185594/4 "2019-06-17T08:01:57Z")

</div>

Ok, I found a workaround.  
Added "dynamic"=false to index creation lines.  
But perhaps there is some better way with automated index creation

---

<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 15, 2019, 8:02am UTC](https://discuss.elastic.co/t/filebeat-csv-to-many-fields-indexed/185594/5 "2019-07-15T08:02:22Z")

</div>

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