# Multiple path search in elasticsearch or regular expression in path

**URL:** <https://discuss.elastic.co/t/multiple-path-search-in-elasticsearch-or-regular-expression-in-path/14458>\
**Category:** Elasticsearch\
**Created:** [November 19, 2013, 5:21am UTC](https://discuss.elastic.co/t/multiple-path-search-in-elasticsearch-or-regular-expression-in-path/14458 "2013-11-19T05:21:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanuj\_bansal](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@tanuj\_bansal](https://discuss.elastic.co/u/tanuj_bansal)\
**Post date:** [November 19, 2013, 5:21am UTC](https://discuss.elastic.co/t/multiple-path-search-in-elasticsearch-or-regular-expression-in-path/14458/1 "2013-11-19T05:21:43Z")

</div>

Hi all:

How can I run my JSON query to search logs from multiple log path same as  
we do for hostname\*  
I am trying to use head plugin in ES

regular expression in hostname - wildcard: {

- logs.host: hostname\*
- }

while using wildcard for hostname it works but when I add path there, it  
search all paths not types of path or specific path  
it searches for cron, message, b.test.log all.

\*My requirement is only a.test.log and b.test.log or _.test.log to search  
for all hosts_

{

- query: {
  - bool: {
    - must: [
      - {
        - range: {
          - logs.@timestamp: {
            - from: 2013-11-19T01:00
            - to: 2013-11-19T01:10  
}  
}  
}

      - {
        - wildcard: {
          - logs.host: hostname\*  
}  
}  
]

    - must\_not: []
    - should: [
      - {
        - query\_string: {
          - default\_field: _default_.path
          - query: /path/a.log  
}  
}  
]  
}  
}

- from: 0
- size: 25000
- sort: []
- facets: { }

}

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:06am UTC](https://discuss.elastic.co/t/multiple-path-search-in-elasticsearch-or-regular-expression-in-path/14458/2 "2017-07-06T02:06:19Z")

</div>


