# General Search Not working on Field

**URL:** <https://discuss.elastic.co/t/general-search-not-working-on-field/216912>\
**Category:** Beats\
**Tags:** functionbeat\
**Created:** [January 28, 2020, 8:59pm UTC](https://discuss.elastic.co/t/general-search-not-working-on-field/216912 "2020-01-28T20:59:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffreygatsby](https://avatars.discourse-cdn.com/v4/letter/j/b5ac83/32.png) [@jeffreygatsby](https://discuss.elastic.co/u/jeffreygatsby)\
**Post date:** [January 28, 2020, 8:59pm UTC](https://discuss.elastic.co/t/general-search-not-working-on-field/216912/1 "2020-01-28T20:59:17Z")

</div>

I'm using FunctionBeat to export ECS logs to Elastic Cloud. Here is my configuration:

```
functionbeat.provider.aws.deploy_bucket: "gatsby-deploy"
functionbeat.provider.aws.functions:
  - name: ProdServiceLogs
    enabled: true
    type: cloudwatch_logs
    description: "Lambda function for transferring 'prod' logs from Cloudwatch '/services/container/prod' to ELK stack index (prod-services)."
    triggers:
      - log_group_name: /services/container/prod

cloud.id: "XXXX"
cloud.auth: "XXXX"
output.elasticsearch.index: "prod-services-%{+yyyy.MM.dd}"
setup.template.name: "prod-services"
setup.template.pattern: "prod-services-*"
setup.ilm.rollover_alias: "prod-services"

processors:
  - if:
      regexp:
        message: "^{"
    then:
      - decode_json_fields:
          fields: ["message"]
          process_array: false
          max_depth: 3
          target: ""
          overwrite_keys: true
      - rename:
          fields:
            - from: "service"
              to: "service.name"

```

We as part of the Json log entry we have a field `user.username` which has the customers email. It gets populated correctly, but if I do a search `"foo@bar.com"` it doesn't show up. But if I do `user.username: "foo@bar.com"`, it shows up correctly.

We have another service that uses Logstash, that also processes the similar logs, and creates two fields `user.username` and `user.username.keyword`. The general search works correctly here.

I noticed that the FunctionBeat makes `user.username` aggregatable, but `user.username` in Logstash version is not, just the `user.username.keyword` is.

How can I make FunctionBeat work like Logstash so I get two fields and `user.username` is searchable with general search?

---

<div class="post-metadata">

**Author:** ![loren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loren/32/44942_2.png) [@loren](https://discuss.elastic.co/u/loren)\
**Post date:** [January 31, 2020, 9:39pm UTC](https://discuss.elastic.co/t/general-search-not-working-on-field/216912/2 "2020-01-31T21:39:36Z")

</div>

What does your index template look like for `prod-services-*`?

---

<div class="post-metadata">

**Author:** ![jeffreygatsby](https://avatars.discourse-cdn.com/v4/letter/j/b5ac83/32.png) [@jeffreygatsby](https://discuss.elastic.co/u/jeffreygatsby)\
**Post date:** [February 1, 2020, 1:41am UTC](https://discuss.elastic.co/t/general-search-not-working-on-field/216912/3 "2020-02-01T01:41:48Z")

</div>

So, I didn't setup anything special in the templates. I just deployed FunctionBeat with the configuration above and it created the everything on ElasticSearch. I then created the Index Pattern for Kibana, but that is it. That said, here is a link to what I think is the template.

[Elastic Search Template](https://gitlab.com/gatsbyfinancial/devops/snippets/1935385)

---

<div class="post-metadata">

**Author:** ![loren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loren/32/44942_2.png) [@loren](https://discuss.elastic.co/u/loren)\
**Post date:** [February 7, 2020, 6:14pm UTC](https://discuss.elastic.co/t/general-search-not-working-on-field/216912/4 "2020-02-07T18:14:08Z")

</div>

Hmm, that link doesn't work for me.

If you post your index mappings/settings we can create a set of Console commands to try to reproduce the issue and see where the behaviors diverge.

---

<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:** [March 6, 2020, 6:14pm UTC](https://discuss.elastic.co/t/general-search-not-working-on-field/216912/5 "2020-03-06T18:14:14Z")

</div>

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