# Field reference for Numbers

**URL:** <https://discuss.elastic.co/t/field-reference-for-numbers/153647>\
**Category:** Logstash\
**Created:** [October 23, 2018, 4:03pm UTC](https://discuss.elastic.co/t/field-reference-for-numbers/153647 "2018-10-23T16:03:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![redX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redx/32/21864_2.png) [@redX](https://discuss.elastic.co/u/redX)\
**Post date:** [October 23, 2018, 4:03pm UTC](https://discuss.elastic.co/t/field-reference-for-numbers/153647/1 "2018-10-23T16:03:18Z")

</div>

Can I use field references for number fields?

For example I have an aggregate filter with a timeout. The timeout configuration expects a number. I have:

```
if [type] == "start" {     
	aggregate {
		task_id => "%{filename}"
		code => "[...]"
		map_action => "create"
	}
}

if [type] == "end" {
	aggregate {
		task_id => "%{filename}"
		code => "[...]"
		map_action => "update"
		end_of_task => true
		push_map_as_event_on_timeout => true
		timeout => 7200
		timeout_code => "[...]"
	}
}

```

The timout is hardcoded to 7200 seconds. I would like to set it via a field reference.  
It is documented for strings here: [https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references)  
Is it possible to do this for numbers? I tried:

- `timeout => "[timeout]"` (timeout was a field on the event)
- `timeout => "%{timeout}` (I pushed the timout to the map beforehand)

But for both variants I get:

- `This setting must be a number. Expected number, got "[timeout]" (type [timeout])`
- or `This setting must be a number. Expected number, got "%{timeout}" (type %{timeout})`

It is documented to work for environment variables: [https://www.elastic.co/guide/en/logstash/current/environment-variables.html](https://www.elastic.co/guide/en/logstash/current/environment-variables.html)

Is it possible to use field references in place of an expected number?

---

<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 20, 2018, 4:03pm UTC](https://discuss.elastic.co/t/field-reference-for-numbers/153647/2 "2018-11-20T16:03:20Z")

</div>

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