<?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: Can I compare a field from two or more subsearches? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-I-compare-a-field-from-two-or-more-subsearches/m-p/155241#M43678</link>
    <description>&lt;P&gt;Why are you still using Powershell?  I ditched it after my first use of MobaXterm.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jun 2015 14:51:24 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-06-12T14:51:24Z</dc:date>
    <item>
      <title>Can I compare a field from two or more subsearches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-compare-a-field-from-two-or-more-subsearches/m-p/155238#M43675</link>
      <description>&lt;P&gt;We have three environments test, stage and prod where we run a script that creates a log file that pr. event lists name of environment, application name, buildversion for the app and the cluster it is installed to, like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;12.06.2015 10:13:32,935 cellName=test applicationName=useradmin-ear buildVersion=1.7.0 clusterName=InternalCluster
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My plan is to create script that creates a table in our documentation wiki showing a table with the environments as columns and applicationnames as rows the buildVersion and then mark the differences. &lt;/P&gt;

&lt;P&gt;But then it struck me that I could save me all that work if I am able to create a search in Splunk doing this. That would be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search in indexes test,stage and prod 
find all applicationNames
where buildVersion is not equal in all indexes
show result in a table as applicationName,test.buildVersion,stage.buildVersion, prod.buildVersion
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I did try to play around with &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/SearchReference/Set"&gt;the set command&lt;/A&gt; without to much luck so far. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;set intersect [search index=stage  source="E:\\logs\allApplicationsWithDetails.log" | fields applicationName,buildVersion] [search index=test source="E:\\logs\\allApplicationsWithDetails.log" | fields applicationName,buildVersion]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;well aware of the fact that this might be a long shot...&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2015 12:29:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-compare-a-field-from-two-or-more-subsearches/m-p/155238#M43675</guid>
      <dc:creator>rune_hellem</dc:creator>
      <dc:date>2015-06-12T12:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can I compare a field from two or more subsearches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-compare-a-field-from-two-or-more-subsearches/m-p/155239#M43676</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=test OR index=stage OR index=prod) source="E:\\logs\allApplicationsWithDetails.log" | stats dc(buildVersion) AS numVersions list(buildVersion) AS versions list(index) AS indices BY applicationName | where numVersions &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The 2 lists map value-to-value (the first value in &lt;CODE&gt;indices&lt;/CODE&gt; goes with the first value in &lt;CODE&gt;versions&lt;/CODE&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2015 14:05:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-compare-a-field-from-two-or-more-subsearches/m-p/155239#M43676</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-12T14:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can I compare a field from two or more subsearches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-compare-a-field-from-two-or-more-subsearches/m-p/155240#M43677</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;

&lt;P&gt;That does it...saves me hours of Powershell-scripting.&lt;/P&gt;

&lt;P&gt;R.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2015 14:47:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-compare-a-field-from-two-or-more-subsearches/m-p/155240#M43677</guid>
      <dc:creator>rune_hellem</dc:creator>
      <dc:date>2015-06-12T14:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can I compare a field from two or more subsearches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-compare-a-field-from-two-or-more-subsearches/m-p/155241#M43678</link>
      <description>&lt;P&gt;Why are you still using Powershell?  I ditched it after my first use of MobaXterm.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2015 14:51:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-compare-a-field-from-two-or-more-subsearches/m-p/155241#M43678</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-12T14:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can I compare a field from two or more subsearches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-compare-a-field-from-two-or-more-subsearches/m-p/155242#M43679</link>
      <description>&lt;P&gt;Tempting, but as it is said: "Choose your battles..." and when working in a company running Windows all over introducing something like MobaXterm is just for the few, not for the masses, so Powershell is the path of least resistance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2015 03:03:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-compare-a-field-from-two-or-more-subsearches/m-p/155242#M43679</guid>
      <dc:creator>rune_hellem</dc:creator>
      <dc:date>2015-06-15T03:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can I compare a field from two or more subsearches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-compare-a-field-from-two-or-more-subsearches/m-p/155243#M43680</link>
      <description>&lt;P&gt;Powershell is for Windows people and MobaXterm is for *nix people.  IMHO, if you have *nix people on staff and not providing something like MobaXterm, you hare seriously hamstringing them and cratering their productivity.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2015 14:04:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-compare-a-field-from-two-or-more-subsearches/m-p/155243#M43680</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-15T14:04:20Z</dc:date>
    </item>
  </channel>
</rss>

