# Wildcard for 2 character in logstash input path

**URL:** <https://discuss.elastic.co/t/wildcard-for-2-character-in-logstash-input-path/96960>\
**Category:** Logstash\
**Created:** [August 14, 2017, 11:36am UTC](https://discuss.elastic.co/t/wildcard-for-2-character-in-logstash-input-path/96960 "2017-08-14T11:36:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beuhlet\_Reseau](https://avatars.discourse-cdn.com/v4/letter/b/e95f7d/32.png) [@Beuhlet\_Reseau](https://discuss.elastic.co/u/Beuhlet_Reseau)\
**Post date:** [August 14, 2017, 11:36am UTC](https://discuss.elastic.co/t/wildcard-for-2-character-in-logstash-input-path/96960/1 "2017-08-14T11:36:16Z")

</div>

Hello,

My problem is very simple...

In my input file i have this :

```
input {
  file {
    path => "/data/logstash/celisible_elkf/DCfw*7_*.txt"
    exclude => "DCfw*6_*.txt"
    type => "cra"
    max_open_files => 30000
  }
}

```

Problem sometimes wrong files are upload...

I wanted just replace 2 character like this :

```
input {
  file {
    path => "/data/logstash/celisible_elkf/DCfw??7_*.txt"
    type => "cra"
    max_open_files => 30000
  }
}

```

But it's seems not work

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 14, 2017, 11:51am UTC](https://discuss.elastic.co/t/wildcard-for-2-character-in-logstash-input-path/96960/2 "2017-08-14T11:51:48Z")

</div>

That should work. Can you run

```
ls /data/logstash/TM/data/opm1za*/cra/celisible_elkf/DCfw??7_*.txt

```

as the Logstash user and get the expected results?

---

<div class="post-metadata">

**Author:** ![Beuhlet\_Reseau](https://avatars.discourse-cdn.com/v4/letter/b/e95f7d/32.png) [@Beuhlet\_Reseau](https://discuss.elastic.co/u/Beuhlet_Reseau)\
**Post date:** [August 14, 2017, 12:12pm UTC](https://discuss.elastic.co/t/wildcard-for-2-character-in-logstash-input-path/96960/3 "2017-08-14T12:12:55Z")

</div>

I try this :

(Logstash user is configured to nologin account )

```
su - logstash -s /bin/bash -c "ls -ltr /data/logstash/celisible_elkf/DCfw??7_*.txt"

```

It's working.

Logstash understand shell language ? I thought no.

So if i understand, this line is correctly understood and executable by logstash ? :

`path => "/data/logstash/celisible_elkf/DCfw*[78]_*_*.txt"`

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 14, 2017, 12:52pm UTC](https://discuss.elastic.co/t/wildcard-for-2-character-in-logstash-input-path/96960/4 "2017-08-14T12:52:08Z")

</div>

I don't think Logstash supports all shell wildcard characters but I'd be surprised if ? didn't work, but I don't think I've used anything but \* myself.

---

<div class="post-metadata">

**Author:** ![Beuhlet\_Reseau](https://avatars.discourse-cdn.com/v4/letter/b/e95f7d/32.png) [@Beuhlet\_Reseau](https://discuss.elastic.co/u/Beuhlet_Reseau)\
**Post date:** [August 14, 2017, 1:11pm UTC](https://discuss.elastic.co/t/wildcard-for-2-character-in-logstash-input-path/96960/5 "2017-08-14T13:11:51Z")

</div>

Yes i go test I keep you informed

It's ok my path line look like :

`/data/logstash/celisible_elkf/DCfw??[78]_*_*.txt`

It's works fine.

Thank you for all @magnusbaeck

---

<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:** [September 11, 2017, 1:11pm UTC](https://discuss.elastic.co/t/wildcard-for-2-character-in-logstash-input-path/96960/6 "2017-09-11T13:11:58Z")

</div>

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