# Event type for class variable

**URL:** <https://discuss.elastic.co/t/event-type-for-class-variable/81674>\
**Category:** Logstash\
**Created:** [April 8, 2017, 8:40am UTC](https://discuss.elastic.co/t/event-type-for-class-variable/81674 "2017-04-08T08:40:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonyang](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jonyang](https://discuss.elastic.co/u/jonyang)\
**Post date:** [April 8, 2017, 8:40am UTC](https://discuss.elastic.co/t/event-type-for-class-variable/81674/1 "2017-04-08T08:40:35Z")

</div>

my log file data looks something like this:  
line 1: date time field; server name + other fields  
subsequent lines: ( details )  
i used the above suggestions successfully saved class variables @@ldate, @@server from the first line :  
ruby {  
init =\> "@@ldate='', @@server='' "  
code =\> "@@ldate=event['ldate'], @@server=event['server']"  
}  
and added these two properties in subsequent detail lines:  
ruby { code =\> "event['ldate'] = @@ldate, event['server'] = @@server" }

however, the values of these properties are in array format. what i am expecting are string.  
"ldate" =\> [  
[0] "2017-03-22 02:15:10",  
[1] "2017-03-22 02:15:10"],

please help

---

<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:** [May 6, 2017, 8:49am UTC](https://discuss.elastic.co/t/event-type-for-class-variable/81674/2 "2017-05-06T08:49:13Z")

</div>

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