Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E859A200D31 for ; Sat, 4 Nov 2017 15:55:26 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E7231160BE7; Sat, 4 Nov 2017 14:55:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1248F160BD5 for ; Sat, 4 Nov 2017 15:55:25 +0100 (CET) Received: (qmail 18798 invoked by uid 500); 4 Nov 2017 14:55:25 -0000 Mailing-List: contact users-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@nifi.apache.org Delivered-To: mailing list users@nifi.apache.org Received: (qmail 18788 invoked by uid 99); 4 Nov 2017 14:55:24 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Nov 2017 14:55:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 313871079F6 for ; Sat, 4 Nov 2017 14:55:24 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.35 X-Spam-Level: X-Spam-Status: No, score=0.35 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_INFOUSMEBIZ=0.75, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_RED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id RYYCXZaMSkeL for ; Sat, 4 Nov 2017 14:55:21 +0000 (UTC) Received: from mail-oi0-f47.google.com (mail-oi0-f47.google.com [209.85.218.47]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 6E52461179 for ; Sat, 4 Nov 2017 14:55:21 +0000 (UTC) Received: by mail-oi0-f47.google.com with SMTP id h200so4169252oib.4 for ; Sat, 04 Nov 2017 07:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=/bZyTAG1Jy3BnZuLzjufP65Eh86GU/SXgAX/kSK+hv4=; b=qT0AsxltjDc3PGtnP4TspJ+drNW5bCY+uvnDiBmbqs/R9sAl9cC0JoP0X+24SJ+rB/ +TmwkT3tCmtuBb6YFNtsv/gyeYxv8FaCcGr10I220RA2/a7mhNTqdWdE8its248qjT3f IEznTvyLpIjPMBF0JMq931VQn0xX2jFF6XNAprLL1vnety0WV1wgnXezowV9TwKUGCsJ RCRalSop3e/o62oKJlFlqLb9RGO4iNAtd9IITWzLvWae6bpN4kcflr7hXF79ts4e9Kgz FO3G6vRTx4bZkTyTqCPKz5mOn6truhCsmf88lMuYrdy9e2EW0bd7+QkHNyobNa7xS5L2 kmnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=/bZyTAG1Jy3BnZuLzjufP65Eh86GU/SXgAX/kSK+hv4=; b=kxsk7KWL56ForoUsqyazYo9HqdudT4cPysHHzl3EY4Z5vDGfGMMrRO0Q94bbP7FWS4 wRAI4gH0UnEzkWZtcsNq64MXf4VMTcv+nunbNHgZefWUMrRIa6Q+bTh/R4zFBo9MVh3e rOPq0e90VUC+i3YUKAa9pzgGzMaynsIGGOqxwHbSPo9CtUIyO/tezTqCk+6gA4+Jyq0E p0tegF6kbKbqUBvh8ExjG2MBsGnGCIoPlLSJnxYR3bCsgYvs02Qd8Gi9Rrj8agDepXCc Eliko6sR0QidOp/Srq8vTOrWYm7+hsNW1l7jF1fYz251pnO7vWhrkemK2DYzU5JQWpma VO2w== X-Gm-Message-State: AMCzsaWDl9BlziqPempguDL0Ci4ni3k09JdyObN1MgtdpoRc9R0gSfIo eoPXcWRg0jQILCghS6UgmAAPPWMJFsA1YqO6K8Y= X-Google-Smtp-Source: ABhQp+TuGq7Qn/DSNhKNmFNEqvS7hZ0xov4hdUFFy7Wc9UZ1Y7PyW+gSDMJtfpfEp82KpI6B2rhj6y4ouDGU5Lqbk0g= X-Received: by 10.202.199.84 with SMTP id x81mr5519244oif.67.1509807314336; Sat, 04 Nov 2017 07:55:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Mike Thomsen Date: Sat, 04 Nov 2017 14:55:03 +0000 Message-ID: Subject: Re: Enrichment flow using ScriptedLookup To: users@nifi.apache.org Content-Type: multipart/alternative; boundary="001a11351408a681d3055d29684f" archived-at: Sat, 04 Nov 2017 14:55:27 -0000 --001a11351408a681d3055d29684f Content-Type: text/plain; charset="UTF-8" You may need to update the logback xml file in the conf folder. There is a line in there for the processor package. Might be too high for info. On Sat, Nov 4, 2017 at 10:50 AM Eric Chaves wrote: > Hi folks, > > I'm trying to adapt the flow described at > https://community.hortonworks.com/articles/138632/data-flow-enrichment-with-nifi-lookuprecord-proces.html > using ScriptedLookupService as replacement for SimpleKeyValueLookupService > to lookup city names and enrich and incoming record. > > When I ran the flow with KeyValueLookupService the field gets enriched > properly but when I use my scriptedlookup the value always come back as > null. The script was pretty simple and I can't figure out where is my > error. I also tried the ScriptLookup (just the script, not the flow) by > AloPresto at > https://gist.github.com/alopresto/78eb1a2c2b878f75f61481269af38a9f with > the same resutls. > > I'm trying to log.info the execution to figure out my mistakes but the > logs are going nowhere. How can I enable logging for services? > > Does anyone spot an error? > > ---[service-lookup.groovy]--- > import org.apache.nifi.lookup.StringLookupService > > class GroovyLookupService implements StringLookupService { > > def lookupTable = [ > '1': 'Paris', > '2': 'Lyon', > '3': 'Marseille', > '4': 'Toulouse', > '5': 'Nice' > ] > > @Override > Optional lookup(final String key) { > log.warn('key value: ', key) > return Optional.ofNullable(lookupTable[key]) > } > } > > lookupService = new GroovyLookupService() > --- > > --001a11351408a681d3055d29684f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable You may need to update the logback xml file in the conf folder. There is a = line in there for the processor package. Might be too high for info.
On Sat, Nov 4, 2017 at 10:50 AM Er= ic Chaves <eric@uolet.com> wrot= e:
Hi folks,
<= br>
I'm trying to adapt the flow described at https://community.hortonworks= .com/articles/138632/data-flow-enrichment-with-nifi-lookuprecord-proces.htm= l using ScriptedLookupService as replacement for=C2=A0SimpleKeyValueLoo= kupService to lookup city names and enrich and incoming record.=C2=A0
=

When I ran the flow with KeyValueLookupService the fiel= d gets enriched properly but when I use my scriptedlookup the value always = come back as null.=C2=A0 The script was pretty simple and I can't figur= e out where is my error. I also tried the ScriptLookup (just the script, no= t the flow) by AloPresto at=C2=A0https://gist.github.= com/alopresto/78eb1a2c2b878f75f61481269af38a9f with the same resutls.

I'm trying to log.info the execution to figure out my mistakes but the l= ogs are going nowhere. How can I enable logging for services?
Does anyone spot an error?

---[service= -lookup.groovy]---
import org.apache.nifi.lookup.StringLooku= pService

class GroovyLookupService implements = StringLookupService {

=C2=A0 def lookupTable =3D [=
=C2=A0 =C2=A0 '1': 'Paris',
=C2=A0 =C2= =A0 '2': 'Lyon',
=C2=A0 =C2=A0 '3': '= Marseille',
=C2=A0 =C2=A0 '4': 'Toulouse',
=C2=A0 =C2=A0 '5': 'Nice'
=C2=A0 ]
<= div>
=C2=A0 =C2=A0 @Override
=C2=A0 =C2=A0 Optional= <String> lookup(final String key) {
=C2=A0 =C2=A0 =C2=A0 lo= g.warn('key value: ', key)
=C2=A0 =C2=A0 =C2=A0 return Op= tional.ofNullable(lookupTable[key])
=C2=A0 =C2=A0 }
}

lookupService =3D new GroovyLookupService()
---

--001a11351408a681d3055d29684f--