@magnusbaeck
Is the syntax correct for the json though?
Can you access fields in this fashion after parsing to json (if in this case payload were the actual target)?
And to add to this, if the json structure is always the same, but some field names might change, can you do it with an index search?
For instance, in his example, if "order_id" were a dynamic name, but always at the same place, how could you access this field?
Can you access fields in this fashion after parsing to json (if in this case payload were the actual target)?
Yes.
For instance, in his example, if "order_id" were a dynamic name, but always at the same place, how could you access this field?
What does "at the same place" mean? Fields aren't positional so there's no way of saying "grab the value from the second field". If the name is dynamic, how would you know which field you're looking for?
What does "at the same place" mean? Fields aren't positional so there's no way of saying "grab the value from the second field". If the name is dynamic, how would you know which field you're looking for?
I see what you mean, I think I'll need some string manipulation for that...
Btw, do you access the fields like this in an "IF" statement?
=> if [jsonData][response][isSuccessful] == true
or
=> if %{[jsonData][response][isSuccessful]} == true
Is there a way to access "Header" without knowing the name of "ThisFieldIsDynamic"?
I cannot find examples that work... and a clean json (using ruby?) solution would be awesome!
You'll have to write a piece of Ruby in a ruby filter that iterates over the values of the response hash and checks what type each value is. If it's a hash then look for the Header subfield in that hash.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.