<?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 Row lookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Row-lookup/m-p/34557#M7475</link>
    <description>&lt;P&gt;Is there any way to lookup row instead column cell?&lt;/P&gt;

&lt;P&gt;For example,&lt;BR /&gt;
row1: header_a, header_b&lt;BR /&gt;
row2: value_a, value_b&lt;BR /&gt;
row3: header_c, header_d&lt;BR /&gt;
row4: value_c, value_d&lt;/P&gt;

&lt;P&gt;| lookup mylookup header_c OUTPUT value_c&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 10:13:33 GMT</pubDate>
    <dc:creator>deodion</dc:creator>
    <dc:date>2020-09-28T10:13:33Z</dc:date>
    <item>
      <title>Row lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Row-lookup/m-p/34557#M7475</link>
      <description>&lt;P&gt;Is there any way to lookup row instead column cell?&lt;/P&gt;

&lt;P&gt;For example,&lt;BR /&gt;
row1: header_a, header_b&lt;BR /&gt;
row2: value_a, value_b&lt;BR /&gt;
row3: header_c, header_d&lt;BR /&gt;
row4: value_c, value_d&lt;/P&gt;

&lt;P&gt;| lookup mylookup header_c OUTPUT value_c&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:13:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Row-lookup/m-p/34557#M7475</guid>
      <dc:creator>deodion</dc:creator>
      <dc:date>2020-09-28T10:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Row lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Row-lookup/m-p/34558#M7476</link>
      <description>&lt;P&gt;You could do this only with a scripted, python-based, lookup command. More &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.2.5/Knowledge/Addfieldsfromexternaldatasources"&gt;infos here&lt;/A&gt;. But I suggest you to reformat the file, if possible.&lt;/P&gt;

&lt;P&gt;If you were to index your lookup file, then you could use a search to "parse" it into key=value pairs, but you would need a way to identify header rows. In the next sample, the file lup.txt is the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;header1,header2
value1,value2
header3,header4,header5
value3,value4,value5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| file /opt/splunkbeta/etc/apps/search/lookups/lup.txt | eval values=_raw | streamstats first(_raw) as header window=1 current=f | search header="head*" | mappy _raw="; ".join(["=".join(t) for t in zip(header.split(","),values.split(","))]) | extract pairdelim="; " kvdelim="="
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;produces key-value pairs from that file. It assumes headers start with "head*". You could use this to join with your search, or elaborate on that. Note: you need to assign the &lt;EM&gt;use_file_operator&lt;/EM&gt; privilege to take advantage of the &lt;EM&gt;file&lt;/EM&gt; command.&lt;/P&gt;

&lt;P&gt;Another way could be to use the multikv command with the multitable option on. But you will have to reformat the file in any case.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 10:47:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Row-lookup/m-p/34558#M7476</guid>
      <dc:creator>Paolo_Prigione</dc:creator>
      <dc:date>2011-12-14T10:47:03Z</dc:date>
    </item>
  </channel>
</rss>

