blob: 2f43e5dea5e4757b1d72ad53fa7c0fec1d137c3e [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></meta><title>LookupRecord</title><link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"></link></head><script type="text/javascript">window.onload = function(){if(self==top) { document.getElementById('nameHeader').style.display = "inherit"; } }</script><body><h1 id="nameHeader" style="display: none;">LookupRecord</h1><h2>Description: </h2><p>Extracts one or more fields from a Record and looks up a value for those fields in a LookupService. If a result is returned by the LookupService, that result is optionally added to the Record. In this case, the processor functions as an Enrichment processor. Regardless, the Record is then routed to either the 'matched' relationship or 'unmatched' relationship (if the 'Routing Strategy' property is configured to do so), indicating whether or not a result was returned by the LookupService, allowing the processor to also function as a Routing processor. The "coordinates" to use for looking up a value in the Lookup Service are defined by adding a user-defined property. Each property that is added will have an entry added to a Map, where the name of the property becomes the Map Key and the value returned by the RecordPath becomes the value for that key. If multiple values are returned by the RecordPath, then the Record will be routed to the 'unmatched' relationship (or 'success', depending on the 'Routing Strategy' property's configuration). If one or more fields match the Result RecordPath, all fields that match will be updated. If there is no match in the configured LookupService, then no fields will be updated. I.e., it will not overwrite an existing value in the Record with a null value. Please note, however, that if the results returned by the LookupService are not accounted for in your schema (specifically, the schema that is configured for your Record Writer) then the fields will not be written out to the FlowFile.</p><p><a href="additionalDetails.html">Additional Details...</a></p><h3>Tags: </h3><p>lookup, enrichment, route, record, csv, json, avro, database, db, logs, convert, filter</p><h3>Properties: </h3><p>In the list below, the names of required properties appear in <strong>bold</strong>. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the <a href="../../../../../html/expression-language-guide.html">NiFi Expression Language</a>.</p><table id="properties"><tr><th>Display Name</th><th>API Name</th><th>Default Value</th><th>Allowable Values</th><th>Description</th></tr><tr><td id="name"><strong>Record Reader</strong></td><td>record-reader</td><td></td><td id="allowable-values"><strong>Controller Service API: </strong><br/>RecordReaderFactory<br/><strong>Implementations: </strong><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.grok.GrokReader/index.html">GrokReader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.xml.XMLReader/index.html">XMLReader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.avro.AvroReader/index.html">AvroReader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.syslog.Syslog5424Reader/index.html">Syslog5424Reader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.cef.CEFReader/index.html">CEFReader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.syslog.SyslogReader/index.html">SyslogReader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.json.JsonTreeReader/index.html">JsonTreeReader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.csv.CSVReader/index.html">CSVReader</a><br/><a href="../../../nifi-scripting-nar/1.19.1/org.apache.nifi.record.script.ScriptedReader/index.html">ScriptedReader</a><br/><a href="../../../nifi-parquet-nar/1.19.1/org.apache.nifi.parquet.ParquetReader/index.html">ParquetReader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.json.JsonPathReader/index.html">JsonPathReader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.lookup.ReaderLookup/index.html">ReaderLookup</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.windowsevent.WindowsEventLogReader/index.html">WindowsEventLogReader</a></td><td id="description">Specifies the Controller Service to use for reading incoming data</td></tr><tr><td id="name"><strong>Record Writer</strong></td><td>record-writer</td><td></td><td id="allowable-values"><strong>Controller Service API: </strong><br/>RecordSetWriterFactory<br/><strong>Implementations: </strong><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.text.FreeFormTextRecordSetWriter/index.html">FreeFormTextRecordSetWriter</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.avro.AvroRecordSetWriter/index.html">AvroRecordSetWriter</a><br/><a href="../../../nifi-scripting-nar/1.19.1/org.apache.nifi.record.script.ScriptedRecordSetWriter/index.html">ScriptedRecordSetWriter</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.csv.CSVRecordSetWriter/index.html">CSVRecordSetWriter</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.xml.XMLRecordSetWriter/index.html">XMLRecordSetWriter</a><br/><a href="../../../nifi-parquet-nar/1.19.1/org.apache.nifi.parquet.ParquetRecordSetWriter/index.html">ParquetRecordSetWriter</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.json.JsonRecordSetWriter/index.html">JsonRecordSetWriter</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.lookup.RecordSetWriterLookup/index.html">RecordSetWriterLookup</a></td><td id="description">Specifies the Controller Service to use for writing out the records</td></tr><tr><td id="name"><strong>Lookup Service</strong></td><td>lookup-service</td><td></td><td id="allowable-values"><strong>Controller Service API: </strong><br/>LookupService<br/><strong>Implementations: </strong><a href="../../../nifi-hbase_1_1_2-client-service-nar/1.19.1/org.apache.nifi.hbase.HBase_1_1_2_ListLookupService/index.html">HBase_1_1_2_ListLookupService</a><br/><a href="../../../nifi-lookup-services-nar/1.19.1/org.apache.nifi.lookup.SimpleCsvFileLookupService/index.html">SimpleCsvFileLookupService</a><br/><a href="../../../nifi-lookup-services-nar/1.19.1/org.apache.nifi.lookup.RestLookupService/index.html">RestLookupService</a><br/><a href="../../../nifi-hbase_2-client-service-nar/1.19.1/org.apache.nifi.hbase.HBase_2_RecordLookupService/index.html">HBase_2_RecordLookupService</a><br/><a href="../../../nifi-couchbase-nar/1.19.1/org.apache.nifi.couchbase.CouchbaseKeyValueLookupService/index.html">CouchbaseKeyValueLookupService</a><br/><a href="../../../nifi-kudu-nar/1.19.1/org.apache.nifi.controller.kudu.KuduLookupService/index.html">KuduLookupService</a><br/><a href="../../../nifi-lookup-services-nar/1.19.1/org.apache.nifi.lookup.DistributedMapCacheLookupService/index.html">DistributedMapCacheLookupService</a><br/><a href="../../../nifi-elasticsearch-client-service-nar/1.19.1/org.apache.nifi.elasticsearch.ElasticSearchStringLookupService/index.html">ElasticSearchStringLookupService</a><br/><a href="../../../nifi-scripting-nar/1.19.1/org.apache.nifi.lookup.script.ScriptedLookupService/index.html">ScriptedLookupService</a><br/><a href="../../../nifi-lookup-services-nar/1.19.1/org.apache.nifi.lookup.maxmind.IPLookupService/index.html">IPLookupService</a><br/><a href="../../../nifi-lookup-services-nar/1.19.1/org.apache.nifi.lookup.SimpleKeyValueLookupService/index.html">SimpleKeyValueLookupService</a><br/><a href="../../../nifi-elasticsearch-client-service-nar/1.19.1/org.apache.nifi.elasticsearch.ElasticSearchLookupService/index.html">ElasticSearchLookupService</a><br/><a href="../../../nifi-hbase_1_1_2-client-service-nar/1.19.1/org.apache.nifi.hbase.HBase_1_1_2_RecordLookupService/index.html">HBase_1_1_2_RecordLookupService</a><br/><a href="../../../nifi-lookup-services-nar/1.19.1/org.apache.nifi.lookup.XMLFileLookupService/index.html">XMLFileLookupService</a><br/><a href="../../../nifi-mongodb-services-nar/1.19.1/org.apache.nifi.mongodb.MongoDBLookupService/index.html">MongoDBLookupService</a><br/><a href="../../../nifi-scripting-nar/1.19.1/org.apache.nifi.lookup.script.SimpleScriptedLookupService/index.html">SimpleScriptedLookupService</a><br/><a href="../../../nifi-lookup-services-nar/1.19.1/org.apache.nifi.lookup.db.SimpleDatabaseLookupService/index.html">SimpleDatabaseLookupService</a><br/><a href="../../../nifi-couchbase-nar/1.19.1/org.apache.nifi.couchbase.CouchbaseRecordLookupService/index.html">CouchbaseRecordLookupService</a><br/><a href="../../../nifi-lookup-services-nar/1.19.1/org.apache.nifi.lookup.db.DatabaseRecordLookupService/index.html">DatabaseRecordLookupService</a><br/><a href="../../../nifi-lookup-services-nar/1.19.1/org.apache.nifi.lookup.PropertiesFileLookupService/index.html">PropertiesFileLookupService</a><br/><a href="../../../nifi-lookup-services-nar/1.19.1/org.apache.nifi.lookup.CSVRecordLookupService/index.html">CSVRecordLookupService</a></td><td id="description">The Lookup Service to use in order to lookup a value in each Record</td></tr><tr><td id="name">Result RecordPath</td><td>result-record-path</td><td></td><td id="allowable-values"></td><td id="description">A RecordPath that points to the field whose value should be updated with whatever value is returned from the Lookup Service. If not specified, the value that is returned from the Lookup Service will be ignored, except for determining whether the FlowFile should be routed to the 'matched' or 'unmatched' Relationship.<br/><strong>Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)</strong></td></tr><tr><td id="name"><strong>Routing Strategy</strong></td><td>routing-strategy</td><td id="default-value">Route to 'success'</td><td id="allowable-values"><ul><li>Route to 'success' <img src="../../../../../html/images/iconInfo.png" alt="Records will be routed to a 'success' Relationship regardless of whether or not there is a match in the configured Lookup Service" title="Records will be routed to a 'success' Relationship regardless of whether or not there is a match in the configured Lookup Service"></img></li><li>Route to 'matched' or 'unmatched' <img src="../../../../../html/images/iconInfo.png" alt="Records will be routed to either a 'matched' or an 'unmatched' Relationship depending on whether or not there was a match in the configured Lookup Service. A single input FlowFile may result in two different output FlowFiles." title="Records will be routed to either a 'matched' or an 'unmatched' Relationship depending on whether or not there was a match in the configured Lookup Service. A single input FlowFile may result in two different output FlowFiles."></img></li></ul></td><td id="description">Specifies how to route records after a Lookup has completed</td></tr><tr><td id="name"><strong>Record Result Contents</strong></td><td>result-contents</td><td id="default-value">Insert Entire Record</td><td id="allowable-values"><ul><li>Insert Entire Record <img src="../../../../../html/images/iconInfo.png" alt="The entire Record that is retrieved from the Lookup Service will be inserted into the destination path." title="The entire Record that is retrieved from the Lookup Service will be inserted into the destination path."></img></li><li>Insert Record Fields <img src="../../../../../html/images/iconInfo.png" alt="All of the fields in the Record that is retrieved from the Lookup Service will be inserted into the destination path." title="All of the fields in the Record that is retrieved from the Lookup Service will be inserted into the destination path."></img></li></ul></td><td id="description">When a result is obtained that contains a Record, this property determines whether the Record itself is inserted at the configured path or if the contents of the Record (i.e., the sub-fields) will be inserted at the configured path.</td></tr><tr><td id="name"><strong>Record Update Strategy</strong></td><td>record-update-strategy</td><td id="default-value">Use Property</td><td id="allowable-values"><ul><li>Replace Existing Values <img src="../../../../../html/images/iconInfo.png" alt="The &quot;Result RecordPath&quot; property will be ignored and the lookup service must be a single simple key lookup service. Every dynamic property value should be a record path. For each dynamic property, the value contained in the field corresponding to the record path will be used as the key in the Lookup Service and the value returned by the Lookup Service will be used to replace the existing value. It is possible to configure multiple dynamic properties to replace multiple values in one execution. This strategy only supports simple types replacements (strings, integers, etc)." title="The &quot;Result RecordPath&quot; property will be ignored and the lookup service must be a single simple key lookup service. Every dynamic property value should be a record path. For each dynamic property, the value contained in the field corresponding to the record path will be used as the key in the Lookup Service and the value returned by the Lookup Service will be used to replace the existing value. It is possible to configure multiple dynamic properties to replace multiple values in one execution. This strategy only supports simple types replacements (strings, integers, etc)."></img></li><li>Use Property <img src="../../../../../html/images/iconInfo.png" alt="The &quot;Result RecordPath&quot; property will be used to determine which part of the record should be updated with the value returned by the Lookup Service" title="The &quot;Result RecordPath&quot; property will be used to determine which part of the record should be updated with the value returned by the Lookup Service"></img></li></ul></td><td id="description">This property defines the strategy to use when updating the record with the value returned by the Lookup Service.</td></tr><tr><td id="name"><strong>Cache Size</strong></td><td>record-path-lookup-miss-result-cache-size</td><td id="default-value">0</td><td id="allowable-values"></td><td id="description">Specifies how many lookup values/records should be cached.Setting this property to zero means no caching will be done and the table will be queried for each lookup value in each record. If the lookup table changes often or the most recent data must be retrieved, do not use the cache.<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr></table><h3>Dynamic Properties: </h3><p>Supports Sensitive Dynamic Properties: <strong>No</strong></p><p>Dynamic Properties allow the user to specify both the name and value of a property.<table id="dynamic-properties"><tr><th>Name</th><th>Value</th><th>Description</th></tr><tr><td id="name">Value To Lookup</td><td id="value">Valid Record Path</td><td>A RecordPath that points to the field whose value will be looked up in the configured Lookup Service<br/><strong>Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)</strong></td></tr></table></p><h3>Relationships: </h3><table id="relationships"><tr><th>Name</th><th>Description</th></tr><tr><td>success</td><td>All records will be sent to this Relationship if configured to do so, unless a failure occurs</td></tr><tr><td>failure</td><td>If a FlowFile cannot be enriched, the unchanged FlowFile will be routed to this relationship</td></tr></table><h3>Reads Attributes: </h3>None specified.<h3>Writes Attributes: </h3><table id="writes-attributes"><tr><th>Name</th><th>Description</th></tr><tr><td>mime.type</td><td>Sets the mime.type attribute to the MIME Type specified by the Record Writer</td></tr><tr><td>record.count</td><td>The number of records in the FlowFile</td></tr></table><h3>State management: </h3>This component does not store state.<h3>Restricted: </h3>This component is not restricted.<h3>Input requirement: </h3>This component requires an incoming relationship.<h3>System Resource Considerations:</h3>None specified.<h3>See Also:</h3><p><a href="../org.apache.nifi.processors.standard.ConvertRecord/index.html">ConvertRecord</a>, <a href="../org.apache.nifi.processors.standard.SplitRecord/index.html">SplitRecord</a>, <a href="../../../nifi-lookup-services-nar/1.19.1/org.apache.nifi.lookup.SimpleKeyValueLookupService/index.html">SimpleKeyValueLookupService</a>, <a href="../../../nifi-lookup-services-nar/1.19.1/org.apache.nifi.lookup.maxmind.IPLookupService/index.html">IPLookupService</a>, <a href="../../../nifi-lookup-services-nar/1.19.1/org.apache.nifi.lookup.db.DatabaseRecordLookupService/index.html">DatabaseRecordLookupService</a></p></body></html>