I am trying to get the JSON encoding but i want a nested array inside but i am getting only for one event id that is only last record output and the rest event id\'s i am ge