<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Lookup in props using combined columns in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-in-props-using-combined-columns/m-p/301298#M56949</link>
    <description>&lt;P&gt;While writing props/transforms for an in house TA, i'm stuck with a tricky situation. I'm making use of lookup file to enrich my dataset. But the lookup is a combination of multiple columns in the  csv and the dataset&lt;/P&gt;

&lt;P&gt;Sample data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;firstname=John surname=Travolta city=xyz
firstname=John surname=Grisham city=abc
firstname=John surname=Mcenroe city=tre
firstname=Henry surname=Grisham city=asdf
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample lookup (mylookup.csv)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;firstname,surname,job
John,Travolta,actor
John,Grisham,writer
John,Mcenroe,sports
Henry,Grisham,doctor
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if I write a SPL, i would write something like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz ..| eval first_sur=firstname."_".surname | join first_sur [|inputlookup mylookup.csv| eval first_sur=firstname."_".surname] | table first_sur,city,job
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How to write in a transforms/props using lookup? I couldn't find any examples using the eval to combine in a lookup&lt;BR /&gt;
I'm looking for something of..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#props.conf
LOOKUP-complete_bio = mylookup  &amp;lt;first_sur&amp;gt; OUTPUT &amp;lt;first_sur&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 07 Jul 2017 14:38:54 GMT</pubDate>
    <dc:creator>koshyk</dc:creator>
    <dc:date>2017-07-07T14:38:54Z</dc:date>
    <item>
      <title>Lookup in props using combined columns</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-in-props-using-combined-columns/m-p/301298#M56949</link>
      <description>&lt;P&gt;While writing props/transforms for an in house TA, i'm stuck with a tricky situation. I'm making use of lookup file to enrich my dataset. But the lookup is a combination of multiple columns in the  csv and the dataset&lt;/P&gt;

&lt;P&gt;Sample data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;firstname=John surname=Travolta city=xyz
firstname=John surname=Grisham city=abc
firstname=John surname=Mcenroe city=tre
firstname=Henry surname=Grisham city=asdf
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample lookup (mylookup.csv)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;firstname,surname,job
John,Travolta,actor
John,Grisham,writer
John,Mcenroe,sports
Henry,Grisham,doctor
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if I write a SPL, i would write something like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz ..| eval first_sur=firstname."_".surname | join first_sur [|inputlookup mylookup.csv| eval first_sur=firstname."_".surname] | table first_sur,city,job
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How to write in a transforms/props using lookup? I couldn't find any examples using the eval to combine in a lookup&lt;BR /&gt;
I'm looking for something of..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#props.conf
LOOKUP-complete_bio = mylookup  &amp;lt;first_sur&amp;gt; OUTPUT &amp;lt;first_sur&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Jul 2017 14:38:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-in-props-using-combined-columns/m-p/301298#M56949</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2017-07-07T14:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup in props using combined columns</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-in-props-using-combined-columns/m-p/301299#M56950</link>
      <description>&lt;P&gt;The lookup command does support matching multiple columns. In SPL you can write like this (no joins required for lookups)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=xyz ..| lookup mylookup.csv firstname surname OUTPUT job| table first_sur,city,job
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And same thing you'll put in your automatic lookup configurations &lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; LOOKUP-complete_bio = mylookup  firstname surname OUTPUT job
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Jul 2017 14:58:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-in-props-using-combined-columns/m-p/301299#M56950</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-07T14:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup in props using combined columns</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-in-props-using-combined-columns/m-p/301300#M56951</link>
      <description>&lt;P&gt;Thank you mate. The query was not as simple as the example, but I made it work.&lt;BR /&gt;
The greatest sentence from Splunk helped me as I had to do few EVAL before lookups&lt;/P&gt;

&lt;P&gt;======&lt;/P&gt;

&lt;H1&gt;    Splunk processes lookups after it processes field extractions, field aliases, and calculated fields (EVAL-* statements). This means that you can use extracted fields, aliased fields, and calculated fields to specify lookups. But you can't use fields discovered by lookups in the configurations of extracted fields, aliased fields, or calculated fields.&lt;/H1&gt;</description>
      <pubDate>Fri, 07 Jul 2017 15:30:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-in-props-using-combined-columns/m-p/301300#M56951</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2017-07-07T15:30:56Z</dc:date>
    </item>
  </channel>
</rss>

