Hi all.
I've been googling this for a couple of days and have not found any help, although I think this problem should be very easy to solve.
I'm using Logstash to import data from MySQL database and export it to Elastic. Everything is working as expected.
But now I want to "combine" the result of 3 fields into a new one, and I cannot figure out how.
From MySQL I get this structure:
- Ticket
- User
- FirstName
- SecondName
- LastName
- User
I would like to combine those 3 fields for each user into new field, let's call it 'completeName'.
I've configured a filter for results like this:
filter {
aggregate {
task_id => "%{ticket_id}"
code => "
map['id'] = event.get('ticket_id')
map['name'] = event.get('ticket_name')
map['issueTime'] = event.get('issue_time')
map['assignedTo'] = {
'id' => event.get('assignedTo_id'),
'userName' => event.get('assignedTo_username'),
'firstName' => event.get('assignedTo_first_name'),
'familyName' => event.get('assignedTo_family_name'),
'secondFamilyName' => event.get('assignedTo_second_family_name'),
'completeName' => **_WHAT HERE?_**
}
... more code here ...
event.cancel()
"
push_previous_map_as_event => true
timeout => 10
}
}
First 3 fields come from ticket. AssignedTo is the user that holds the ticket, that is mapped to ES as Object inside ticket.
I am getting everything mapped correctly to ES, only missing 'completeName', that sholud be: FirstName FamilyName SecondFamilyName.
Thanks for help.
Regards.