<?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: Subsearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Subsearch/m-p/639209#M221484</link>
    <description>&lt;P&gt;Thanks you so much for a quick help. I got the result as expected &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Today I learned that single quotes denotes a field and double quotes denotes a string. Thanks a lot ...&lt;/P&gt;</description>
    <pubDate>Fri, 07 Apr 2023 14:15:09 GMT</pubDate>
    <dc:creator>RanjiRaje</dc:creator>
    <dc:date>2023-04-07T14:15:09Z</dc:date>
    <item>
      <title>Subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch/m-p/639190#M221474</link>
      <description>&lt;P&gt;Hi everyone, My post is huge. sorry for that. I need suggestion from you for the query I framed.&lt;/P&gt;&lt;P&gt;I have 2 lookup used (lookfileA, lookfileB)&lt;/P&gt;&lt;P&gt;column: &lt;STRONG&gt;BaseA&lt;/STRONG&gt; &amp;gt; count by division in lookupfileA&lt;BR /&gt;column: &lt;STRONG&gt;Column_IndexA&lt;/STRONG&gt; &amp;gt; to compare lookfileA under indexA and get matching host count&lt;BR /&gt;column: &lt;STRONG&gt;BaseB&lt;/STRONG&gt; &amp;gt; count by division in lookupfileB&lt;BR /&gt;column: &lt;STRONG&gt;Inscope&lt;/STRONG&gt; &amp;gt; count by division in lookupfileB with Active status&lt;BR /&gt;column: &lt;STRONG&gt;Column_OtherIndexes&lt;/STRONG&gt; &amp;gt; to compare lookfileB under otherindexes and get matching host count&lt;/P&gt;&lt;P&gt;index=indexA&lt;BR /&gt;| lookup &lt;STRONG&gt;lookfileA&lt;/STRONG&gt; host as hostname OUTPUTNEW Division&lt;BR /&gt;| fields hostname,Division&lt;BR /&gt;| stats dc(hostname) as "&lt;STRONG&gt;Column_IndexA&lt;/STRONG&gt;" by Division&lt;BR /&gt;| append&lt;BR /&gt;[| tstats count where index IN ("win","linux") by host&lt;BR /&gt;| eval host=upper(host)&lt;BR /&gt;| fields - count&lt;BR /&gt;| join type=inner host&lt;BR /&gt;[| inputlookup &lt;STRONG&gt;lookfileA&lt;/STRONG&gt;&lt;BR /&gt;| fields host, Division&lt;BR /&gt;| eval host=upper(host)]&lt;BR /&gt;| stats count as "&lt;STRONG&gt;Column_OtherIndexes&lt;/STRONG&gt;" by Division]&lt;BR /&gt;| append&lt;BR /&gt;[| inputlookup &lt;STRONG&gt;lookfileA&lt;/STRONG&gt;&lt;BR /&gt;| stats count as "&lt;STRONG&gt;BaseA&lt;/STRONG&gt;" by Division]&lt;BR /&gt;| append&lt;BR /&gt;[| inputlookup &lt;STRONG&gt;lookfileB&lt;/STRONG&gt;&lt;BR /&gt;| stats count as &lt;STRONG&gt;BaseB&lt;/STRONG&gt; by category&lt;BR /&gt;| where category IN ("Win","Linux")&lt;BR /&gt;| rename category as Division]&lt;BR /&gt;| append&lt;BR /&gt;[| inputlookup &lt;STRONG&gt;lookfileB&lt;/STRONG&gt;&lt;BR /&gt;| stats count as &lt;STRONG&gt;Inscope&lt;/STRONG&gt; by category,status&lt;BR /&gt;| where category IN ("Win","Linux") AND status="Active"&lt;BR /&gt;| rename category as Division]&lt;BR /&gt;| fields Division,BaseB,Inscope,"Column_OtherIndexes","BaseA","Column_IndexA"&lt;BR /&gt;| stats values(*) as * by Division&lt;BR /&gt;| table Division,BaseB,Inscope,"Column_OtherIndexes","BaseA","Column_IndexA"&lt;BR /&gt;| eval Difference="Column_IndexA" -&amp;nbsp;"Column_OtherIndexes"&lt;BR /&gt;| fillnull value=0&lt;BR /&gt;| addtotals col=t row=f labelfield=Division label=Total&lt;/P&gt;&lt;P&gt;Below is the sample output and I need to get difference column. Used eval command but getting error&lt;/P&gt;&lt;TABLE width="569"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="64"&gt;Division&lt;/TD&gt;&lt;TD width="64"&gt;BaseB&lt;/TD&gt;&lt;TD width="64"&gt;Inscope&lt;/TD&gt;&lt;TD width="145"&gt;Column_OtherIndexes&lt;/TD&gt;&lt;TD width="64"&gt;BaseA&amp;nbsp;&lt;/TD&gt;&lt;TD width="104"&gt;Column_IndexA&lt;/TD&gt;&lt;TD width="64"&gt;&lt;STRONG&gt;Difference&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;M&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;200-50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;N&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;200-20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Total&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;TD&gt;70&lt;/TD&gt;&lt;TD&gt;600&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;TD&gt;400-70&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 07 Apr 2023 10:12:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch/m-p/639190#M221474</guid>
      <dc:creator>RanjiRaje</dc:creator>
      <dc:date>2023-04-07T10:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch/m-p/639206#M221482</link>
      <description>&lt;P&gt;What error did you get from the &lt;FONT face="courier new,courier"&gt;eval&lt;/FONT&gt; command?&lt;/P&gt;&lt;P&gt;I suspect eval is having a problem substracting one string constant from another.&amp;nbsp; Put the field names in single quotes rather than double quotes.&amp;nbsp; On the RHS, single quotes denote a field name and double quotes denote a string.&amp;nbsp; In fact, quotation marks are not needed at all with those names.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Difference = 'Column_IndexA' - 'Column_OtherIndexes'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 14:00:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch/m-p/639206#M221482</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-04-07T14:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch/m-p/639209#M221484</link>
      <description>&lt;P&gt;Thanks you so much for a quick help. I got the result as expected &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Today I learned that single quotes denotes a field and double quotes denotes a string. Thanks a lot ...&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 14:15:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch/m-p/639209#M221484</guid>
      <dc:creator>RanjiRaje</dc:creator>
      <dc:date>2023-04-07T14:15:09Z</dc:date>
    </item>
  </channel>
</rss>

