# Please help - if statement for match rules

**URL:** <https://discuss.elastic.co/t/please-help-if-statement-for-match-rules/224271>\
**Category:** Logstash\
**Created:** [March 19, 2020, 1:21pm UTC](https://discuss.elastic.co/t/please-help-if-statement-for-match-rules/224271 "2020-03-19T13:21:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![calanon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/calanon/32/64004_2.png) [@calanon](https://discuss.elastic.co/u/calanon)\
**Post date:** [March 19, 2020, 1:21pm UTC](https://discuss.elastic.co/t/please-help-if-statement-for-match-rules/224271/1 "2020-03-19T13:21:45Z")

</div>

I would like to match two items with the rule below. How can I make this with an if statement?

```
  date { 
    match => ["fgt_timestamp", "yyyyMMdd HHmmss", "yyyy-MM-dd HH:mm:ss"]  
    target => "std_timestamp" 
    timezone => "Europe/Berlin" 
    add_field => { "debug" => "timestampMatched" } 
  }

```

I want to match the fgt\_timestamp and another one called hht\_timestamp also, is this possible?

---

<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:** [March 22, 2020, 4:25pm UTC](https://discuss.elastic.co/t/please-help-if-statement-for-match-rules/224271/2 "2020-03-22T16:25:28Z")

</div>

If you need to parse two date fields then you need two date filters.

---

<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:** [April 19, 2020, 4:25pm UTC](https://discuss.elastic.co/t/please-help-if-statement-for-match-rules/224271/3 "2020-04-19T16:25:30Z")

</div>

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