<?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 Re: Lookup when format is not equal. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Lookup-when-format-is-not-equal/m-p/240898#M71606</link>
    <description>&lt;P&gt;You can use evals to change the format prior to the lookup.  I often take everything to lowercase/uppercase prior to joins and lookups.  Your requirements would be a bit trickier but Martin has done the tricky eval part it appears.&lt;/P&gt;</description>
    <pubDate>Sun, 13 Mar 2016 21:58:13 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2016-03-13T21:58:13Z</dc:date>
    <item>
      <title>Lookup when format is not equal.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-when-format-is-not-equal/m-p/240896#M71604</link>
      <description>&lt;P&gt;I already have a CSV file for an other app that uses mac to IP/Name.&lt;/P&gt;

&lt;P&gt;Format is like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mac,ip,host_name
6067.209c.ce2c,10.10.10.186,pc-test
c01a.da25.da0e,10.10.10.163,server
100b.a91e.5cdc,10.10.10.160,phone
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I have an other input that looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;nic1 BC:F2:AF:C6:F0:25 TX 209 mbps
nic1 BC:F2:AF:C6:F0:18 TX 129 mbps
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a way to do a lookup for the mac in the mac to IP/Host file when format is different?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 20:13:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-when-format-is-not-equal/m-p/240896#M71604</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2016-03-13T20:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup when format is not equal.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-when-format-is-not-equal/m-p/240897#M71605</link>
      <description>&lt;P&gt;You could schedule a search that adds the other format to the lookup file periodically, and use that in your automatic lookup. Something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup file
| eval mac2 = coalesce(mac2, replace(replace(upper(mac), "\.", ""), "([^:][^:])(?!$)", "\1:"))
| outputlookup file
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You'd have the original value in &lt;CODE&gt;mac&lt;/CODE&gt; and the other notation in &lt;CODE&gt;mac2&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 21:47:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-when-format-is-not-equal/m-p/240897#M71605</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-03-13T21:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup when format is not equal.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-when-format-is-not-equal/m-p/240898#M71606</link>
      <description>&lt;P&gt;You can use evals to change the format prior to the lookup.  I often take everything to lowercase/uppercase prior to joins and lookups.  Your requirements would be a bit trickier but Martin has done the tricky eval part it appears.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 21:58:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-when-format-is-not-equal/m-p/240898#M71606</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-03-13T21:58:13Z</dc:date>
    </item>
  </channel>
</rss>

