Open yq4103 opened 2 years ago
Hi, you can do this:
[
{
"operation": "modify-overwrite-beta",
"spec": {
"myString": "=split('\\.',@(1,myString))"
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"myString": "=lastElement(@(1,myString))"
}
}
]
Can someone help me with the spec for this transformation? Thanks a lot. The length of the string may change, and the number of "." is also not fixed. After the jolt transform, I only want to keep the part of the string which comes after the last "." So I don't think substring is gonna work in this case.
JSON input:
{ "myString": "keep.only.the.last.word" }
Expected output:
{ "myString": "word" }