I have this log
{ [-]
duration: 3005
finishTime: 2021-08-25T15:47:26.838196
logger: splunk
startTime: 2021-08-25T15:47:23.832269
stepTransitionDuration: [ [+]
]
traceSteps: [ [-]
{ [+]
}
{ [+]
}
{ [+]
}
{ [+]
}
{ [+]
}
{ [+]
}
{ [+]
}
{ [+]
}
{ [+]
}
{ [+]
}
{ [+]
}
{ [+]
}
{ [+]
}
{ [+]
}
{ [+]
}
{ [-]
logType: info
message: Response
res: { [-]
httpStatus: 400
}
timestamp: 2021-08-25T15:47:26.838195
title: Response
}
]
xrayTraceId:
}
How can i access only the last item (in bold letter)?
I tried to access with mvindex but return blank results.
Try something like this
| spath path=traceSteps{} output=traceSteps
| eval lasttrace=mvindex(traceSteps,-1)
| spath input=lasttrace
Try something like this
| spath path=traceSteps{} output=traceSteps
| eval lasttrace=mvindex(traceSteps,-1)
| spath input=lasttrace
Thanks @ITWhisperer