<?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 adding lookup or eval to transforms.conf in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/adding-lookup-or-eval-to-transforms-conf/m-p/40900#M9470</link>
    <description>&lt;P&gt;I would like to do an eval on every log entry, from a certian sourcetype.  In this case I have a real number that I would like to quantize.&lt;/P&gt;

&lt;P&gt;I also have a series of IPs that I would like to group by location.  I am using a lookup at search, but I am only interested one or two locations for a search.  Some of the IP ranges are /24, so I would also like to use wildcards.&lt;/P&gt;

&lt;P&gt;I would like to make these changes when the log is loaded and not at search time so that I can search by location.  Do I do this in transforms.conf? or is there another location?&lt;/P&gt;</description>
    <pubDate>Tue, 08 Feb 2011 23:10:11 GMT</pubDate>
    <dc:creator>fk319</dc:creator>
    <dc:date>2011-02-08T23:10:11Z</dc:date>
    <item>
      <title>adding lookup or eval to transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-lookup-or-eval-to-transforms-conf/m-p/40900#M9470</link>
      <description>&lt;P&gt;I would like to do an eval on every log entry, from a certian sourcetype.  In this case I have a real number that I would like to quantize.&lt;/P&gt;

&lt;P&gt;I also have a series of IPs that I would like to group by location.  I am using a lookup at search, but I am only interested one or two locations for a search.  Some of the IP ranges are /24, so I would also like to use wildcards.&lt;/P&gt;

&lt;P&gt;I would like to make these changes when the log is loaded and not at search time so that I can search by location.  Do I do this in transforms.conf? or is there another location?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2011 23:10:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-lookup-or-eval-to-transforms-conf/m-p/40900#M9470</guid>
      <dc:creator>fk319</dc:creator>
      <dc:date>2011-02-08T23:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: adding lookup or eval to transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-lookup-or-eval-to-transforms-conf/m-p/40901#M9471</link>
      <description>&lt;P&gt;You can not automatically call an eval out of the box using transforms.conf.  You could create a macro though to minimize your typing.  Instead of typing&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval some_var=&amp;lt;some eval opeartion&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you would type&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... `macro_name`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Wildcards are not currently supported in lookups but you do have a few options.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;You can &lt;A href="http://answers.splunk.com/questions/5916/using-cidr-in-a-lookup-table" rel="nofollow"&gt;create a scripted input&lt;/A&gt; to do it.&lt;/LI&gt;
&lt;LI&gt;You can use &lt;A href="http://answers.splunk.com/questions/5916/using-cidr-in-a-lookup-table" rel="nofollow"&gt;event types&lt;/A&gt;.&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;You can leverage the search language (note: the below example would need to be updated for different mask bits)  &lt;/P&gt;

&lt;P&gt;... | rex field=ip "(?\d{1,3}.\d{1,3}.\d{1,3}.)" | strcat cidr_test "0/24" cidr_test | eval cidr=if(cidrmatch(cidr_test,ip),cidr_test,null) | where isnotnull(cidr) | lookup cidr OUTPUT location | search location="home_office"&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Wed, 09 Feb 2011 06:41:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-lookup-or-eval-to-transforms-conf/m-p/40901#M9471</guid>
      <dc:creator>bwooden</dc:creator>
      <dc:date>2011-02-09T06:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: adding lookup or eval to transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-lookup-or-eval-to-transforms-conf/m-p/40902#M9472</link>
      <description>&lt;P&gt;You can not do this at index time (except by preprocessing your data before it even gets to Splunk). &lt;/P&gt;

&lt;P&gt;You &lt;EM&gt;can&lt;/EM&gt; configure automatic lookups that execute a script that can do whatever operations you need on the incoming data however.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2011 06:43:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-lookup-or-eval-to-transforms-conf/m-p/40902#M9472</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-02-09T06:43:15Z</dc:date>
    </item>
  </channel>
</rss>

