You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Igor Kravzov <ig...@gmail.com> on 2016/05/11 21:23:20 UTC

SplitJson configuration question

Looks like am missing something. How to configure SplitJson to split array
like bellow to individual JSON files. Basically split on "root" of array.

[{
  "id":1,
   "data":"data1"
   },
    {
      "id":2,
       "data":"data2"
    }
]

Result should be to separate files
{
  "id":1,
   "data":"data1"
   }

{
  "id":2,
   "data":"data2"
   }

Thanks in advance.

Re: SplitJson configuration question

Posted by Hong Li <ho...@centricconsulting.com>.
I'm using $.[*].



*Hong Li*

*Centric Consulting*

*In Balance*
(888) 781-7567 office
(614) 296-7644 mobile
www.centricconsulting.com | @Centric <https://twitter.com/centric>

On Wed, May 11, 2016 at 5:28 PM, Matt Burgess <ma...@gmail.com> wrote:

> I believe $.* should work to split at the root.
>
>
> > On May 11, 2016, at 5:23 PM, Igor Kravzov <ig...@gmail.com>
> wrote:
> >
> > Looks like am missing something. How to configure SplitJson to split
> array like bellow to individual JSON files. Basically split on "root" of
> array.
> >
> > [{
> >   "id":1,
> >    "data":"data1"
> >    },
> >     {
> >       "id":2,
> >        "data":"data2"
> >     }
> > ]
> >
> > Result should be to separate files
> > {
> >   "id":1,
> >    "data":"data1"
> >    }
> >
> > {
> >   "id":2,
> >    "data":"data2"
> >    }
> >
> > Thanks in advance.
>

Re: SplitJson configuration question

Posted by Igor Kravzov <ig...@gmail.com>.
Thanks Matt. It worked.

On Wed, May 11, 2016 at 5:28 PM, Matt Burgess <ma...@gmail.com> wrote:

> I believe $.* should work to split at the root.
>
>
> > On May 11, 2016, at 5:23 PM, Igor Kravzov <ig...@gmail.com>
> wrote:
> >
> > Looks like am missing something. How to configure SplitJson to split
> array like bellow to individual JSON files. Basically split on "root" of
> array.
> >
> > [{
> >   "id":1,
> >    "data":"data1"
> >    },
> >     {
> >       "id":2,
> >        "data":"data2"
> >     }
> > ]
> >
> > Result should be to separate files
> > {
> >   "id":1,
> >    "data":"data1"
> >    }
> >
> > {
> >   "id":2,
> >    "data":"data2"
> >    }
> >
> > Thanks in advance.
>

Re: SplitJson configuration question

Posted by Matt Burgess <ma...@gmail.com>.
I believe $.* should work to split at the root.


> On May 11, 2016, at 5:23 PM, Igor Kravzov <ig...@gmail.com> wrote:
> 
> Looks like am missing something. How to configure SplitJson to split array like bellow to individual JSON files. Basically split on "root" of array.
> 
> [{
>   "id":1,
>    "data":"data1"
>    },
>     { 
>       "id":2,
>        "data":"data2"
>     }
> ]
> 
> Result should be to separate files
> {
>   "id":1,
>    "data":"data1"
>    }
> 
> {
>   "id":2,
>    "data":"data2"
>    }
> 
> Thanks in advance.