<?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: Searching a lookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674345#M230833</link>
    <description>&lt;P&gt;thanks for the reply but&amp;nbsp; I want the total count when the timeval is latest. (in this case 2023), so according to my lookup result should be 2. with BIE count is 0 and&amp;nbsp; RAD count is 2 so 0+2=2. Hope this helps in understanding&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jan 2024 10:04:40 GMT</pubDate>
    <dc:creator>Siddharthnegi</dc:creator>
    <dc:date>2024-01-16T10:04:40Z</dc:date>
    <item>
      <title>Searching a lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674343#M230831</link>
      <description>&lt;P&gt;I have this lookup&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Siddharthnegi_0-1705395632145.png" style="width: 753px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28947i9704393DA3621C02/image-dimensions/753x166?v=v2" width="753" height="166" role="button" title="Siddharthnegi_0-1705395632145.png" alt="Siddharthnegi_0-1705395632145.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I want the total count when the timeval is latest. (in this case 2023) any solution&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 09:57:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674343#M230831</guid>
      <dc:creator>Siddharthnegi</dc:creator>
      <dc:date>2024-01-16T09:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674344#M230832</link>
      <description>&lt;P&gt;If you want to just get some statistical report on data read from your lookup, use the inputlookup command.&lt;/P&gt;&lt;P&gt;Like&lt;/P&gt;&lt;PRE&gt;| inputlookup mylookup | stats count&lt;/PRE&gt;&lt;P&gt;will give you number of rows in your lookup. You can do any operation on fields read from the lookup that you would normally do in a "normal" event search.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 09:59:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674344#M230832</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-01-16T09:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674345#M230833</link>
      <description>&lt;P&gt;thanks for the reply but&amp;nbsp; I want the total count when the timeval is latest. (in this case 2023), so according to my lookup result should be 2. with BIE count is 0 and&amp;nbsp; RAD count is 2 so 0+2=2. Hope this helps in understanding&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 10:04:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674345#M230833</guid>
      <dc:creator>Siddharthnegi</dc:creator>
      <dc:date>2024-01-16T10:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674347#M230834</link>
      <description>&lt;P&gt;And what have you tried so far? And how the results weren't meeting your expectations?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 10:11:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674347#M230834</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-01-16T10:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674355#M230838</link>
      <description>&lt;P&gt;if i try to find count i am only getting count of either BIE or RAD . But I want count of both combined .&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 10:52:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674355#M230838</guid>
      <dc:creator>Siddharthnegi</dc:creator>
      <dc:date>2024-01-16T10:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674367#M230843</link>
      <description>&lt;P&gt;What is your search then?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 13:37:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674367#M230843</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-01-16T13:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674377#M230844</link>
      <description>&lt;P&gt;| inputlookup abc.csv&lt;BR /&gt;| eval CompanyCode="DSPL"&lt;BR /&gt;| eventstats values(CompanyCode) as CompanyCode&lt;BR /&gt;| eval 3Let=case(CompanyCode == "DSDE", "BIE", CompanyCode == "DSDE-AS", "PUT", CompanyCode == "DSDE-FS", "STL", CompanyCode == "CSDE", "DAR", CompanyCode == "DSPL", "RAD", CompanyCode == "DSMX", "QUE", CompanyCode == "DSUS", "SSC")&lt;BR /&gt;| where '3Let'='place'&lt;BR /&gt;| sort - timeval&lt;BR /&gt;| table count timeval&lt;BR /&gt;| head 1&lt;BR /&gt;|appendpipe [stats count | where count==0&lt;BR /&gt;| eval timeval=strftime(now(),"%Y") | where count==0]&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 14:15:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674377#M230844</guid>
      <dc:creator>Siddharthnegi</dc:creator>
      <dc:date>2024-01-16T14:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674383#M230845</link>
      <description>&lt;P&gt;OK. We're getting somewhere &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;| inputlookup abc.csv&lt;BR /&gt;| eval CompanyCode="DSPL"&lt;BR /&gt;| eventstats values(CompanyCode) as CompanyCode&lt;BR /&gt;| eval 3Let=case(CompanyCode == "DSDE", "BIE", CompanyCode == "DSDE-AS", "PUT", CompanyCode == "DSDE-FS", "STL", CompanyCode == "CSDE", "DAR", CompanyCode == "DSPL", "RAD", CompanyCode == "DSMX", "QUE", CompanyCode == "DSUS", "SSC")&lt;BR /&gt;| where '3Let'='place'&lt;/PRE&gt;&lt;P&gt;OK. I assume this produces your data set and it works pretty OK.&lt;/P&gt;&lt;P&gt;But now if you want to have _all_ events for which a particular field has a value which is max of all possible, you have several options available (for example using subsearches) but the easiest one will be to add an additional field which tells you which value is the max year value. For this we use eventstats.&lt;/P&gt;&lt;PRE&gt;| eventstats max(timeval) as maxyear&lt;/PRE&gt;&lt;P&gt;Now you have an additional field telling you which year is the max year. So now just filter your values to only leave those where your timeval is equal to that maxyear&lt;/P&gt;&lt;PRE&gt;| where timeval=maxyear&lt;/PRE&gt;&lt;P&gt;And you should be all set &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 14:51:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-a-lookup/m-p/674383#M230845</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-01-16T14:51:01Z</dc:date>
    </item>
  </channel>
</rss>

