# Logstash match add\_field using dynamic field

**URL:** <https://discuss.elastic.co/t/logstash-match-add-field-using-dynamic-field/224150>\
**Category:** Logstash\
**Created:** [March 18, 2020, 4:15pm UTC](https://discuss.elastic.co/t/logstash-match-add-field-using-dynamic-field/224150 "2020-03-18T16:15:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elady](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@elady](https://discuss.elastic.co/u/elady)\
**Post date:** [March 18, 2020, 4:15pm UTC](https://discuss.elastic.co/t/logstash-match-add-field-using-dynamic-field/224150/1 "2020-03-18T16:15:09Z")

</div>

Hey.  
I am parsing a big log file with many different log line types.  
What I am trying to do is to both pars parameters and keep a full line in a field called "text".  
The problem is Logstash fails to create the pipeline when executed with my configuration.

This is a REALLY shortened version of my Logstash configuration file:

```
input {
file {
	path => "/opt/some/path/to/file.txt"
	start_position => "beginning"
    codec => multiline {
		pattern => "^%{TIMESTAMP_ISO8601}"
		negate => true
		what => "previous"
		max_lines => 1000
	}
	type => "aaa"
}
}
filter {
if [type] == "aaa" {
	grok {
		break_on_match => true
		match => {
			"message" => "%{TIMESTAMP_ISO8601:event_timestamp}%{SPACE}%{DATA:log_level}%{SPACE}\[%{DATA:host}\]%{SPACE}\[%{DATA:tenant}\]%{SPACE}\[%{DATA:java_class}\]%{SPACE}-%{SPACE}<Properties for the task %{DATA:task} has been set>"
			"path" => "%{GREEDYDATA:filename}"
			add_field => { "text" => "Properties for the task %{task} has been set" }
			add_tag => ["bbb"]
		}
	}
}
date {
	match => ["event_timestamp", "YYYY-MM-dd HH:mm:ss.SSS"]
	timezone => "Etc/GMT"
	locale => "en"
}
}
output {
elasticsearch {
	hosts => ["xxx", "xxy", "xxz"]
	index => "test"
	timeout => 120
	user => "xxxxx"
	password => "xxxxx"
}
}

```

The problem is the %{task} within the add\_field which was parsed on the match above it.

The error i get is:

> :exception=\>"NameError"  
> :message=\>"uninitialized constant LogStashCompilerLSCLGrammar::LogStash::Compiler::LSCL::AST:: Hash::ConfigurationError"

I will very much appreciate your help.  
Thank you.

---

<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 15, 2020, 4:15pm UTC](https://discuss.elastic.co/t/logstash-match-add-field-using-dynamic-field/224150/2 "2020-04-15T16:15:12Z")

</div>

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