# Correct syntax for log.file.path

**URL:** <https://discuss.elastic.co/t/correct-syntax-for-log-file-path/235949>\
**Category:** Elastic Stack\
**Created:** [June 5, 2020, 12:26pm UTC](https://discuss.elastic.co/t/correct-syntax-for-log-file-path/235949 "2020-06-05T12:26:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maria\_Daniel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maria_daniel/32/69697_2.png) [@Maria\_Daniel](https://discuss.elastic.co/u/Maria_Daniel)\
**Post date:** [June 5, 2020, 12:26pm UTC](https://discuss.elastic.co/t/correct-syntax-for-log-file-path/235949/1 "2020-06-05T12:26:37Z")

</div>

Hello!

I'm trying to attribute a _"delivery\_conn\_r"_ tag to logs from files ending with _".results"_. All other files get a _"delivery\_conn\_t"_ tag.

This is what's on my pipeline thus far:

```auto
if "delivery_conn" in [tags] {
		if ([log][file][path] =~ "/var/log/conn/././%{UUID}\.results"){
			grok {
				match => { 
						"[log][file][path]" => "/var/log/conn/././%{UUID:message_token}\.results"
					}
				add_tag => ["my_parsed_tag", "delivery_conn_r"]
			}
		} else {
			grok {
				match => { 
						"[log][file][path]" => "/var/log/conn/././%{UUID:message_token}"
					}
				add_tag => ["my_parsed_tag", "delivery_conn_t"]
			}
		}
	
	}

```

However, all logs are entering the second clause and being treated as non-.results tags. I think something might be wrong with the log.file.path syntax on my second if-clause:

```auto
if ([log][file][path] =~ "/var/log/conn/././%{UUID}\.results")

```

BTW I have checked that this regex should work for my filepath.

Can anyone suggest what might be wrong?

---

<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:** [November 4, 2022, 8:01am UTC](https://discuss.elastic.co/t/correct-syntax-for-log-file-path/235949/2 "2022-11-04T08:01:20Z")

</div>


