<?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 Filtering search results with mvfilter in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-search-results-with-mvfilter/m-p/459122#M79304</link>
    <description>&lt;P&gt;I'm creating a dashboard that displays events relating to servers ("host" field in the search). I want to allow the user to specify the hosts to include via a checkbox dashboard input, however I cannot get this to work.&lt;/P&gt;

&lt;P&gt;To simplify the development process, I've mocked up the input into a search as so:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;eventtype=SomeEventType | eval servers="serverName01;serverName02;serverName03" | makemv delim=";" servers | search mvfilter(host,servers)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;(In the dashboard I obviously don't need to "eval servers=" and the "servers" is referenced $servers$, again I only changed this so I could play around with it in the raw search app)&lt;/P&gt;

&lt;P&gt;...With my understanding is that it should filter the search results based on those that return "true." The search doesn't error out, but I get no results. However, with the search instead as simply:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;eventtype=SomeEventType host="serverName01"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I &lt;EM&gt;do&lt;/EM&gt; get results back.&lt;/P&gt;

&lt;P&gt;How do I filter the results, correctly?&lt;/P&gt;</description>
    <pubDate>Tue, 14 May 2019 21:53:18 GMT</pubDate>
    <dc:creator>CaninChristellC</dc:creator>
    <dc:date>2019-05-14T21:53:18Z</dc:date>
    <item>
      <title>Filtering search results with mvfilter</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-search-results-with-mvfilter/m-p/459122#M79304</link>
      <description>&lt;P&gt;I'm creating a dashboard that displays events relating to servers ("host" field in the search). I want to allow the user to specify the hosts to include via a checkbox dashboard input, however I cannot get this to work.&lt;/P&gt;

&lt;P&gt;To simplify the development process, I've mocked up the input into a search as so:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;eventtype=SomeEventType | eval servers="serverName01;serverName02;serverName03" | makemv delim=";" servers | search mvfilter(host,servers)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;(In the dashboard I obviously don't need to "eval servers=" and the "servers" is referenced $servers$, again I only changed this so I could play around with it in the raw search app)&lt;/P&gt;

&lt;P&gt;...With my understanding is that it should filter the search results based on those that return "true." The search doesn't error out, but I get no results. However, with the search instead as simply:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;eventtype=SomeEventType host="serverName01"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I &lt;EM&gt;do&lt;/EM&gt; get results back.&lt;/P&gt;

&lt;P&gt;How do I filter the results, correctly?&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 21:53:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-search-results-with-mvfilter/m-p/459122#M79304</guid>
      <dc:creator>CaninChristellC</dc:creator>
      <dc:date>2019-05-14T21:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering search results with mvfilter</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-search-results-with-mvfilter/m-p/459123#M79305</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You are not even using the mvfilter function, you are searching for it as a string.&lt;/P&gt;

&lt;P&gt;What is the goal, do you want to filter for events that have the host in the list of servers, or do you want to change the servers list somehow?&lt;/P&gt;

&lt;P&gt;If it is the former question, then you could use the mvfind command, eg:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval host="serverName02", servers="serverName01;serverName02;serverName03" 
| makemv delim=";" servers 
| where isnotnull(mvfind(servers,host))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is that what you were looking for?&lt;/P&gt;

&lt;P&gt;Hth,&lt;BR /&gt;
Kai.&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 07:15:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-search-results-with-mvfilter/m-p/459123#M79305</guid>
      <dc:creator>knielsen</dc:creator>
      <dc:date>2019-05-15T07:15:55Z</dc:date>
    </item>
  </channel>
</rss>

