Add filter to send specific fields to elasticsearch

OK, so maybe a prune filter is what you want. It is not installed by default, the documentation that I linked to before explains how to install it.

filter {
  prune {
    whitelist_names => ["^hostname$", "^message$", "^source" ]
  }
}