See if the following generic option helps.
You can ignore everything up to foreach, as this is what I used to replicate your issue in my lab.
| stats count | fields - count
| eval _raw = "
{
\"oderNumber\": 23994,
\"orderDelay\": 120,
\"orderedDate\": \"2016/03/01 18:47:22\",
\"processedDate\": \"\",
\"orderDetails\": \"Account:11111, AccountName:1111-xxx, OrderIpAddress:1.1.1.1\",
\"orderProcessor\": \"user\",
\"orderErrors\": \"\",
\"acknowledgedErrors\": \"\",
\"orderId\": {
\"value\": 97655
}
}
"
| spath
| foreach * [
| eval temp = split('<<FIELD>>', ",")
| eval size = mvcount(temp)
| mvexpand temp
| rex field=temp "^(?<key>[^:]+)\s?:\s?(?<value>.+)$"
| eval {key} = if (size > 1, value, null())
| fields - key, value, size, temp
]
| stats first(*) as * by _raw
... View more