# Remove timezone/timestamp from my data field?

**URL:** <https://discuss.elastic.co/t/remove-timezone-timestamp-from-my-data-field/222768>\
**Category:** Logstash\
**Created:** [March 9, 2020, 4:44pm UTC](https://discuss.elastic.co/t/remove-timezone-timestamp-from-my-data-field/222768 "2020-03-09T16:44:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![samargh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samargh/32/70171_2.png) [@samargh](https://discuss.elastic.co/u/samargh)\
**Post date:** [March 9, 2020, 4:44pm UTC](https://discuss.elastic.co/t/remove-timezone-timestamp-from-my-data-field/222768/1 "2020-03-09T16:44:30Z")

</div>

how can i delete the timezone/timestamp from my data field ?  
i need it to get only : Disconnection Date Sep 16, 2020  
not this !!  
Disconnection Date Sep 16, 2020 @ 23:00:00.000  
Activation Date Aug 13, 2019 @ 23:00:00.000  
help

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 9, 2020, 5:14pm UTC](https://discuss.elastic.co/t/remove-timezone-timestamp-from-my-data-field/222768/2 "2020-03-09T17:14:08Z")

</div>

Where can you this?

---

<div class="post-metadata">

**Author:** ![samargh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samargh/32/70171_2.png) [@samargh](https://discuss.elastic.co/u/samargh)\
**Post date:** [March 9, 2020, 6:28pm UTC](https://discuss.elastic.co/t/remove-timezone-timestamp-from-my-data-field/222768/3 "2020-03-09T18:28:49Z")

</div>

i don't get u  
sorry  
i'm working on logstash / elasticsearch  
it genrates the time wich i need to set a condition to remove in the collection phase  
cuz it's causing me problems later in kibana (visualize)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 10, 2020, 8:29am UTC](https://discuss.elastic.co/t/remove-timezone-timestamp-from-my-data-field/222768/4 "2020-03-10T08:29:47Z")

</div>

I meant:

> Where can you **see** this?

> [@samargh](#):
>
> i'm working on logstash / elasticsearch  
> it genrates the time wich i need to set a condition to remove in the collection phase  
> cuz it's causing me problems later in kibana (visualize)

I don't understand. Do you have a practical example?

---

<div class="post-metadata">

**Author:** ![samargh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samargh/32/70171_2.png) [@samargh](https://discuss.elastic.co/u/samargh)\
**Post date:** [March 10, 2020, 9:08am UTC](https://discuss.elastic.co/t/remove-timezone-timestamp-from-my-data-field/222768/5 "2020-03-10T09:08:17Z")

</div>

this code works fine  
but i want to know what to add as a condition/filter to not add the time cuz its cuzing me problems

```auto
filter{
       csv{
               separator => ","
               columns => ["Subscriber ID ",---,"Activation Date"]
				
		}
		ruby {
                code => "
                        hash = event.to_hash
                        hash.each do |k,v|
                                if v == nil
                                        event.remove(k)
                                end
                        end
                "
        }	
	mutate {
			add_field => {"DATE"=> ["2020-01-03"]}
		}
			
		date {
			match => ["Service F-- Date", "YYYY-MM-dd"]
		}
		date {	
			match => ["Supervision -- Date", "YYYY-MM-dd"]
			target => "Supervision -- Date"
		}
		
		date {
			match => ["Account d-- Date", "YYYY-MM-dd"]
			target => "Account d-- Date"
		}
		
		date {
			match => ["Activation Date", "YYYY-MM-dd"]
			target => "Activation Date"
		}
}

```

just to know , this is ligne of my data :

```auto
54,54,0,0,,0,1,2,0,0,0,1,0,0,0,0,0,16,16,,0.02,1,2020-04-08,2020-01-09,,2020-08-06,0,0,2020-04-08,0,0,,0,0,0,0,0,0,0,0,0,0,0,2014-09-06 

```

all the dates i have dosen't contain any time but elastic or logstash is adding the timezone or timestamp  
so how can i set a condition to remove it ??

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 10, 2020, 9:28am UTC](https://discuss.elastic.co/t/remove-timezone-timestamp-from-my-data-field/222768/6 "2020-03-10T09:28:16Z")

</div>

> [@samargh](#):
>
> this is ligne of my data

Just in case you'd prefer speak in french we have a forum #Discussions en français. 😉

You can use the [mutate filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html) to remove a field.

I believe that the `@timestamp` field is added by the input plugin you are using.

BTW, I moving your question to #logstash.

---

<div class="post-metadata">

**Author:** ![samargh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samargh/32/70171_2.png) [@samargh](https://discuss.elastic.co/u/samargh)\
**Post date:** [March 10, 2020, 10:17am UTC](https://discuss.elastic.co/t/remove-timezone-timestamp-from-my-data-field/222768/7 "2020-03-10T10:17:00Z")

</div>

haha okay i'll try it (the frensh one ) 😉

---

<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 7, 2020, 10:17am UTC](https://discuss.elastic.co/t/remove-timezone-timestamp-from-my-data-field/222768/8 "2020-04-07T10:17:17Z")

</div>

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