<?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 How Can I Compare Fields Against Another SourceType? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-Can-I-Compare-Fields-Against-Another-SourceType/m-p/194613#M38726</link>
    <description>&lt;P&gt;I have two source types - &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;One with a list of hosts and their software (DataIn).&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;The other with a list of ideal version numbers for that software (IdealData).&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I want to be able to compare the newest entry for hosts against the newest ideal software version.&lt;/P&gt;

&lt;P&gt;I can't just use the newest host entry because there may be multiple entries for different software.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;EG. Comparing DataIn vs. IdealData&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sourcetypes -
DataIn - Time,IP,MAC,Hostname,Software,Version
IdealData - Time, Software, Version

DataIn -
1/15/15, , ,Box1,VisiCalc,4
1/15/15, , ,Box1,Lotus,2
1/10/15, , ,Box2,VisiCalc,1

IdealData -
1/16/15,VisiCalc,3
1/5/15,VisiCalc,1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this situation Box 2 would not be running the latest version, but Box 1 would.&lt;/P&gt;

&lt;P&gt;Ideally I'd love to produce a list of hosts, showing the software that is out of date, but everything I'm trying isn't working.  I'd love any help.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jan 2015 20:58:19 GMT</pubDate>
    <dc:creator>taylornat</dc:creator>
    <dc:date>2015-01-15T20:58:19Z</dc:date>
    <item>
      <title>How Can I Compare Fields Against Another SourceType?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-Can-I-Compare-Fields-Against-Another-SourceType/m-p/194613#M38726</link>
      <description>&lt;P&gt;I have two source types - &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;One with a list of hosts and their software (DataIn).&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;The other with a list of ideal version numbers for that software (IdealData).&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I want to be able to compare the newest entry for hosts against the newest ideal software version.&lt;/P&gt;

&lt;P&gt;I can't just use the newest host entry because there may be multiple entries for different software.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;EG. Comparing DataIn vs. IdealData&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sourcetypes -
DataIn - Time,IP,MAC,Hostname,Software,Version
IdealData - Time, Software, Version

DataIn -
1/15/15, , ,Box1,VisiCalc,4
1/15/15, , ,Box1,Lotus,2
1/10/15, , ,Box2,VisiCalc,1

IdealData -
1/16/15,VisiCalc,3
1/5/15,VisiCalc,1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this situation Box 2 would not be running the latest version, but Box 1 would.&lt;/P&gt;

&lt;P&gt;Ideally I'd love to produce a list of hosts, showing the software that is out of date, but everything I'm trying isn't working.  I'd love any help.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2015 20:58:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-Can-I-Compare-Fields-Against-Another-SourceType/m-p/194613#M38726</guid>
      <dc:creator>taylornat</dc:creator>
      <dc:date>2015-01-15T20:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Compare Fields Against Another SourceType?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-Can-I-Compare-Fields-Against-Another-SourceType/m-p/194614#M38727</link>
      <description>&lt;P&gt;Assuming both the sourcetypes have _time field defined (timestamp recognition is setup). Try following query: -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=A sourcetype=DataIn | stats latest(Version) as CurrentVersion by IP,MAC,Hostname,Software 
| join type=left Software [ search index=B sourcetype=IdealData | stats latest(Version) as IdealVersion by Software ]
| fillnull value="NA" IdealVersion 
| where IdealVersion!=CurrentVersion
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Jan 2015 21:53:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-Can-I-Compare-Fields-Against-Another-SourceType/m-p/194614#M38727</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-01-15T21:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Compare Fields Against Another SourceType?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-Can-I-Compare-Fields-Against-Another-SourceType/m-p/194615#M38728</link>
      <description>&lt;P&gt;Thank you so much for going to all this trouble.&lt;/P&gt;

&lt;P&gt;This works great!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=A sourcetype=DataIn | stats latest(Version) as CurrentVersion by IP,MAC,Hostname,Software
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;amp; This works great!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=B sourcetype=IdealData | stats latest(Version) as IdealVersion by Software
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;EM&gt;(although it repeats one Software title twice - not sure if that matters - same version)&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;However, the whole query doesn't work as I expected -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;IP               MAC                  Hostname     Software    Cur.  IdealVersion
192.168.0.200   1A-A2-FF-EA-E4-C1   UserBox35   Lotus 123   7   NA   
192.168.0.50     D6-45-CE-D3-C2-6B  UserBox20   Lotus 123   4   NA
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would expect UserBox20 not to be in a list of Hosts that meet the ideal version (which is 5+)&lt;BR /&gt;
(or to be included only if it was a list of Hosts that don't meet the ideal version).&lt;/P&gt;

&lt;P&gt;Is it something I've done wrong or something the search doesn't account for?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2015 22:31:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-Can-I-Compare-Fields-Against-Another-SourceType/m-p/194615#M38728</guid>
      <dc:creator>taylornat</dc:creator>
      <dc:date>2015-01-15T22:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Compare Fields Against Another SourceType?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-Can-I-Compare-Fields-Against-Another-SourceType/m-p/194616#M38729</link>
      <description>&lt;P&gt;Can you try the search without the "| where..." clause and see if you get values for IdealVersion field at all?&lt;BR /&gt;
Mean other than value="NA".&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2015 22:36:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-Can-I-Compare-Fields-Against-Another-SourceType/m-p/194616#M38729</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-01-15T22:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Compare Fields Against Another SourceType?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-Can-I-Compare-Fields-Against-Another-SourceType/m-p/194617#M38730</link>
      <description>&lt;P&gt;It has the same results - with UserBox20 the same as before &amp;amp; NA for the IdealVersion.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2015 22:40:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-Can-I-Compare-Fields-Against-Another-SourceType/m-p/194617#M38730</guid>
      <dc:creator>taylornat</dc:creator>
      <dc:date>2015-01-15T22:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Compare Fields Against Another SourceType?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-Can-I-Compare-Fields-Against-Another-SourceType/m-p/194618#M38731</link>
      <description>&lt;P&gt;We are joining based on field "Software", it may be possible that values are not same between two sourcetypes. To validate, run following query and let me know.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=A sourcetype=DataIn)  OR (index=B sourcetype=IdealData | stats values(sourcetype) as sourcetypes by Software
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;above search should gives either 2 valued field sourcetype for the common 'Software' values.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2015 22:44:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-Can-I-Compare-Fields-Against-Another-SourceType/m-p/194618#M38731</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-01-15T22:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Compare Fields Against Another SourceType?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-Can-I-Compare-Fields-Against-Another-SourceType/m-p/194619#M38732</link>
      <description>&lt;P&gt;Here are the results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Software   sourcetypes
Eudora   IdealDATA
           DataIN
Lotus 123  IdealDATA
           DataIN
WordStar   IdealDATA
           DataIN
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It gives both sourcetypes for each type of Software.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2015 23:52:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-Can-I-Compare-Fields-Against-Another-SourceType/m-p/194619#M38732</guid>
      <dc:creator>taylornat</dc:creator>
      <dc:date>2015-01-15T23:52:14Z</dc:date>
    </item>
  </channel>
</rss>

