<?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: relating fields with eval in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/relating-fields-with-eval/m-p/203610#M59143</link>
    <description>&lt;P&gt;First you'll need to search for events from both sourcetypes, then normalize your Node field to match the NodeID field, and then do whatever you're actually trying to do with the data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  sourcetype=eventsWithNodeID OR sourcetype=eventsWithNode
| rex field=Node "0*(?&amp;lt;tempNodeID&amp;gt;\d+)$" | eval mergedNodeID = case(sourcetype="eventsWithNodeID", NodeID, sourcetype="eventsWithNode", tempNodeID)
| stats values(foo) as foo max(bar) as bar by mergedNodeID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Check out the excellent March 2016 Virtual.conf talk by @sideview on this very subject available at &lt;A href="http://wiki.splunk.com/Virtual_.conf"&gt;http://wiki.splunk.com/Virtual_.conf&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 12 Jun 2016 19:57:05 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2016-06-12T19:57:05Z</dc:date>
    <item>
      <title>relating fields with eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/relating-fields-with-eval/m-p/203608#M59141</link>
      <description>&lt;P&gt;I have two fields (different sourcetypes) that have a Node ( for example: node001) and NodeID (example: 1)&lt;/P&gt;

&lt;P&gt;How would i extract Node to NodeID dealing with the leading zeros?&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jun 2016 18:46:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/relating-fields-with-eval/m-p/203608#M59141</guid>
      <dc:creator>jrich523</dc:creator>
      <dc:date>2016-06-12T18:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: relating fields with eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/relating-fields-with-eval/m-p/203609#M59142</link>
      <description>&lt;P&gt;Hi. Something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=X OR sourcetype=Y | rename Node* as *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can be an option.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jun 2016 19:50:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/relating-fields-with-eval/m-p/203609#M59142</guid>
      <dc:creator>changux</dc:creator>
      <dc:date>2016-06-12T19:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: relating fields with eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/relating-fields-with-eval/m-p/203610#M59143</link>
      <description>&lt;P&gt;First you'll need to search for events from both sourcetypes, then normalize your Node field to match the NodeID field, and then do whatever you're actually trying to do with the data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  sourcetype=eventsWithNodeID OR sourcetype=eventsWithNode
| rex field=Node "0*(?&amp;lt;tempNodeID&amp;gt;\d+)$" | eval mergedNodeID = case(sourcetype="eventsWithNodeID", NodeID, sourcetype="eventsWithNode", tempNodeID)
| stats values(foo) as foo max(bar) as bar by mergedNodeID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Check out the excellent March 2016 Virtual.conf talk by @sideview on this very subject available at &lt;A href="http://wiki.splunk.com/Virtual_.conf"&gt;http://wiki.splunk.com/Virtual_.conf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jun 2016 19:57:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/relating-fields-with-eval/m-p/203610#M59143</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-06-12T19:57:05Z</dc:date>
    </item>
  </channel>
</rss>

