I am trying to convert the epoch timestamps which comes in an array.
"steps": [
{
"number": 1,
"status": "COMPLETE",
"doRetry": null,
"progress": null,
"startTime": 1710431698,
"rowCount": null,
"endTime": 1710431699
},
{
"number": 2,
"status": null,
"startTime": 1710431698,
"doRetry": null,
"progress": null
},
{
"number": 3,
"status": "COMPLETE",
"startTime": 1710431698,
"doRetry": null,
"progress": null,
"endTime": 1710431734,
"rowCount": null
},
{
"number": 4,
"status": null,
"doRetry": null,
"progress": null
},
{
"number": 5,
"status": null,
"doRetry": null,
"startTime": 1710431698,
"progress": null
},
{
"number": 6,
"status": null,
"doRetry": null,
"endTime": 1710431734,
"progress": null
}
]
```
Here is my ruby and date filter
```
if [steps][startTime] {ruby{code => "event.set('endTime',event.get('endTime').to_i* 1000)"}}
if [steps][endTime] {ruby{code => "event.set('endTime',event.get('endTime').to_i* 1000)"}}
date {
match => [ "[steps][startTime]","UNIX_MS" ]
target => "[steps][startTime]"
timezone => "America/Toronto"
}
date {
match => [ "[steps][endTime]","UNIX_MS" ]
target => "[steps][endTime]"
timezone => "America/Toronto"
}
it didn't work
Note: startTime and endTime doesn't come in each index of array.