# Adding 1 day to the date

**URL:** <https://discuss.elastic.co/t/adding-1-day-to-the-date/129168>\
**Category:** Logstash\
**Created:** [April 23, 2018, 7:24pm UTC](https://discuss.elastic.co/t/adding-1-day-to-the-date/129168 "2018-04-23T19:24:53Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![HRG](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@HRG](https://discuss.elastic.co/u/HRG)\
**Post date:** [April 24, 2018, 1:49pm UTC](https://discuss.elastic.co/t/adding-1-day-to-the-date/129168/3 "2018-04-24T13:49:19Z")

</div>

Thank you Jenni for the info. I have tried but getting below error. Can you please advise anything is missing in the code

**Error**  
[2018-04-24T09:43:48,356][ERROR][logstash.filters.ruby] Ruby exception occurred: no implicit conversion of Fixnum into String  
[2018-04-24T09:43:48,356][ERROR][logstash.filters.ruby] Ruby exception occurred: no implicit conversion of Fixnum into String  
[2018-04-24T09:43:48,357][ERROR][logstash.filters.ruby] Ruby exception occurred: no implicit conversion of Fixnum into String

**Code**  
grok {  
match =\> ["BusinessDate", "%{YEAR:year}%{MONTHNUM:month}%{MONTHDAY:day}"]  
overwrite =\> ["message"]  
}

```
    if "_grokparsefailure" in [tags] {		
		mutate {				
			remove_tag => ["_grokparsefailure"]					
		}				
	}

# Set Timestamp

mutate {
	add_field => {
		ExpectedTime => "03:00:00:000"
	}
}

mutate {
	add_field => {
		BusinesDateTime => "%{year}-%{month}-%{day} %{ExpectedTime}"
	}
}
#Not required ExptectedTime in output
mutate {
	remove_field => [ExpectedTime]
}

#Convert to Date
date
{
	match => ["BusinesDateTime", "YYYY-MM-DD HH:mm:ss.SSS"]				
}

#Adding one day to BusinessDateTime

ruby {
code => 'event.set("BusinesDateTime", LogStash::Timestamp.new(event.get("BusinesDateTime")+86400))'
}
```

---

_[View the full topic](https://discuss.elastic.co/t/adding-1-day-to-the-date/129168)._
