I think you could use ConvertRecord processor with a json reader and writer.

Pierre

Le 25 août 2017 9:25 PM, "Jones, Patrick L." <p...@mitre.org> a écrit :

> Yolanda,
>
>
>
>             Yes, I am looking for a more dynamic solution.  I have a bunch
> of different “value” that I would like to turn to strings.  Using wildcards
> if possible would certainly make my life easier.
>
>
>
> Thank you,
>
>
>
> Pat
>
>
>
>
>
>
>
> *From:* Yolanda Davis [mailto:yolanda.m.da...@gmail.com]
> *Sent:* Friday, August 25, 2017 3:20 PM
> *To:* users@nifi.apache.org
> *Subject:* Re: Jolt Quesiton
>
>
>
> Hi Pat,
>
>
>
> Give the below spec a try:
>
>
>
>  {
>
>       "val": {
>
>         "*": {
>
>           "value": "=toString"
>
>         }
>
>       },
>
>       "arr": {
>
>         "value": "=toString"
>
>       }
>
>     }
>
>
>
> It is more specific on matching the incoming labels.  So I believe in your
> spec you had a section that accounted for the array entry (the section with
> the "val" label), however you also needed something that could match on the
> basic key/value entry (with the "arr" label).  The above should work.
> However I can also work through a more dynamic solution for you if you need
> it?
>
>
>
> Please let me know if this helps,
>
>
>
> Yolanda
>
>
>
> On Fri, Aug 25, 2017 at 2:50 PM, pat <p...@mitre.org> wrote:
>
> Howdy,
>
>   I'm trying to get jolt to change all of my "value" to strings.  I can't
> figure out how to do it.
> My source json is:
> {
>         "val": [{
>                 "value": 230
>         }],
>         "arr": {
>                 "value": 9878
>         }
> }
>
> my modify overwrite spec is
> {
>
>         "*": {
>                 "value": "=toString",
>                 "*": {
>                         "value": "=toString"
>                 }
>         }
> }
>
> and the result is:
> {
>         "val": [{
>                 "value": "230"
>         }],
>         "arr": {
>                 "value": 9878
>         }
> }
>
> Any thoughts on how to get past this?  I can't seem to get both of these to
> change to strings
>
>
> thank you
>
>
>
> --
> View this message in context: http://apache-nifi-users-list.
> 2361937.n4.nabble.com/Jolt-Quesiton-tp2759.html
> Sent from the Apache NiFi Users List mailing list archive at Nabble.com.
>
>
>
>
>
> --
>
> --
>
> yolanda.m.da...@gmail.com
>
> @YolandaMDavis
>
>
>

Reply via email to