New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a function to insert current datetime? #531
Comments
There is no way to ask jolt for "now". Gets into a messy world of date formatting. I recommend "ninjaing" the data to the json first, and then using Jolt to push that data to all the places you want it to go. |
For example, if you could fix your input "before jolt" to be Input {
"ninjaed-in-time": "2018-03-06T15:38:19Z",
"list": [
{
"ProdId": "Filler",
"ProductName": "Z Dry Filler",
"Trait": "",
"Variety": "",
"SuggestedRetailPrice": "0.0000",
"CropId": "",
"DeptId": "067001"
},
{
"ProdId": "Clay",
"ProductName": "Z Clay",
"Trait": "",
"Variety": "",
"SuggestedRetailPrice": "0.0000",
"CropId": "",
"DeptId": "067001"
}
]
} Spec [
{
"operation": "modify-default-beta",
"spec": {
"list": {
"*": {
"LastUpdated": "@(3,ninjaed-in-time)"
}
}
}
},
{
"operation": "shift",
"spec": {
"list": ""
}
}
] Would generate the output you want. |
Thank you. |
What does "ninjaed" stand for? |
In this context it means "sneak". Before Jolt, "sneak"/"ninja" in an extra field, and then use Jolt to pull/use that field. |
How can you accomplish this in Java? Any suggestions? |
Need assistance on trying to insert the current date/time using Jolt.
I tried (as shown below) using "${now()}"; but the output is not producing the date/time.
JSON input:
Jolt Spec:
Output:
I'm not sure Jolt can even accept such variables.
Thanks in advance for any assistance.
The text was updated successfully, but these errors were encountered: