# Logstash: ingest only message on elasticsearch

**URL:** <https://discuss.elastic.co/t/logstash-ingest-only-message-on-elasticsearch/206474>\
**Category:** Logstash\
**Created:** [November 4, 2019, 8:17pm UTC](https://discuss.elastic.co/t/logstash-ingest-only-message-on-elasticsearch/206474 "2019-11-04T20:17:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianferrol](https://avatars.discourse-cdn.com/v4/letter/b/91b2a8/32.png) [@brianferrol](https://discuss.elastic.co/u/brianferrol)\
**Post date:** [November 4, 2019, 8:17pm UTC](https://discuss.elastic.co/t/logstash-ingest-only-message-on-elasticsearch/206474/1 "2019-11-04T20:17:42Z")

</div>

Hi there!

I'm trying to ingest a json file from AWS s3 to ElasticSearch.

I've created an index with the mapping I need, but Logstash adds `@timestamp` , `@version` and puts the whole json file into `message`. How can I get **only the message field content** (ingest the raw json).

The thing is, if I add this logstash fields to the index mapping, I won't be able to use message's fields in the way I want to use them in **Kibana** as they would be `"nested_json"` type.

This is my logstash.conf:

```auto
input {
  s3 {
    access_key_id => "XXX"
    secret_access_key => "XXXXX"
    region => "eu-west-1"
    bucket => "XXXXX"
    interval => "10"
  }
}
 
output {
  elasticsearch {
    hosts => ["XXXXX"]
    index => "indiceprueba1"
    user => "XXXXX"
    password => "XXXXX"
  }
}

```

My index mapping looks like this:

```auto
PUT indiceprueba1 
{
  "mappings": {
    "properties": {
      "callid": {
        "type": "text"
      },
      "cdidcli": {
        "type": "text"
      },
      "calldate": {
        "type": "date",
        "format": "year_month_day"
      },
      "conversation": {
        "type": "text"
      },
      "text_spk1": {
        "type": "text", 
        "term_vector": "yes", 
        "fielddata": true, 
        "store": true
      },
      "text_spk2": {
        "type": "text", 
        "term_vector": "yes", 
        "fielddata": true, 
        "store": true
      } 
    } 
  } 
}

```

I hope everything was explained clearly.

Thank you!

Brian

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 4, 2019, 8:28pm UTC](https://discuss.elastic.co/t/logstash-ingest-only-message-on-elasticsearch/206474/2 "2019-11-04T20:28:11Z")

</div>

Use a json filter, or possibly a json codec on the input.

---

<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:** [December 2, 2019, 8:33pm UTC](https://discuss.elastic.co/t/logstash-ingest-only-message-on-elasticsearch/206474/3 "2019-12-02T20:33:21Z")

</div>

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