<?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: how to do &amp;quot;where field in&amp;quot; with splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143525#M39871</link>
    <description>&lt;P&gt;And it's inconvenient for me to use OR, because, the list could be a form input field. If user enter some names in the form field, I want my query to take that as parameter. Also, the list is long, to use OR query will make the query even longer to read&lt;/P&gt;</description>
    <pubDate>Fri, 25 Apr 2014 20:05:50 GMT</pubDate>
    <dc:creator>hongduan</dc:creator>
    <dc:date>2014-04-25T20:05:50Z</dc:date>
    <item>
      <title>how to do "where field in" with splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143521#M39867</link>
      <description>&lt;P&gt;I need to do a query which looks like &lt;BR /&gt;
field in [list of values]. The list could be another query's return values.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 15:32:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143521#M39867</guid>
      <dc:creator>hongduan</dc:creator>
      <dc:date>2014-04-25T15:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to do "where field in" with splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143522#M39868</link>
      <description>&lt;P&gt;Can provide more information, possibly with some examples?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 17:35:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143522#M39868</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-04-25T17:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to do "where field in" with splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143523#M39869</link>
      <description>&lt;P&gt;So, you're looking for a set of results where a specific field (or list of fields) exist?  So, let's say you have a field called 'myfield'.  You want to show a list of results where myfield exists, right?&lt;/P&gt;

&lt;P&gt;If your search has something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex myfield=*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then only events with a field called myfield will return.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 19:58:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143523#M39869</guid>
      <dc:creator>mloven_splunk</dc:creator>
      <dc:date>2014-04-25T19:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to do "where field in" with splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143524#M39870</link>
      <description>&lt;P&gt;Here is what I want to do;&lt;/P&gt;

&lt;P&gt;I have such logs:&lt;BR /&gt;
name="Susan", date=20130101&lt;BR /&gt;
name="David", date=20140101&lt;BR /&gt;
name="Mike", date=20130102&lt;BR /&gt;
name="SomeName", date=20140102&lt;BR /&gt;
name="Test", date=20130101&lt;BR /&gt;
.....more log records&lt;/P&gt;

&lt;P&gt;I want to query looks like:&lt;BR /&gt;
name in ("Susan", "Mike", ....)&lt;BR /&gt;
The names in bracket is a long list.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 20:03:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143524#M39870</guid>
      <dc:creator>hongduan</dc:creator>
      <dc:date>2014-04-25T20:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to do "where field in" with splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143525#M39871</link>
      <description>&lt;P&gt;And it's inconvenient for me to use OR, because, the list could be a form input field. If user enter some names in the form field, I want my query to take that as parameter. Also, the list is long, to use OR query will make the query even longer to read&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 20:05:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143525#M39871</guid>
      <dc:creator>hongduan</dc:creator>
      <dc:date>2014-04-25T20:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to do "where field in" with splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143526#M39872</link>
      <description>&lt;P&gt;Try something like this. Here you have pass list of names as comma separated values (which should be easier with form input as well.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourindex [|stats count | eval name="Susan,David,Mike" | table name| eval name=split(name,",") | mvexpand name| format]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In dashboards, it could be like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourindex [|stats count | eval name="$nameValues$" | table name| eval name=split(name,",") | mvexpand name| format]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Apr 2014 20:49:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143526#M39872</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-04-25T20:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to do "where field in" with splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143527#M39873</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;because, the list could be a form&lt;BR /&gt;
input field&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;So, this sounds like you want to match &lt;STRONG&gt;any&lt;/STRONG&gt; value for 'name', right?  Because a user could put 'Susan' or 'David', but could also put 'mloven'.  So, again, my first answer would work in this scenario.&lt;/P&gt;

&lt;P&gt;Maybe paste in some actual logs, and give an example of what you want the search to do.  We can probably provide a more exact solution then.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 20:50:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143527#M39873</guid>
      <dc:creator>mloven_splunk</dc:creator>
      <dc:date>2014-04-25T20:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to do "where field in" with splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143528#M39874</link>
      <description>&lt;P&gt;awesome. That's exactly what I need. Is it possible I could upload a file with the possible values and do the search.&lt;BR /&gt;
Something like: a file contains: "Susan,David,Mike". and in splunk query reference to the file.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 21:52:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143528#M39874</guid>
      <dc:creator>hongduan</dc:creator>
      <dc:date>2014-04-25T21:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to do "where field in" with splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143529#M39875</link>
      <description>&lt;P&gt;You can upload your file (list of name) as lookup table file and then use it in the query. E.g. your lookup table, say names.csv, with header as name and one name per row. Add that a lookup table under appropriate app and set necessary sharing permission. Then the updated query could be like this&lt;/P&gt;

&lt;P&gt;index=yourindex [|inputlookup names.csv ]&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2014 21:01:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-do-quot-where-field-in-quot-with-splunk/m-p/143529#M39875</guid>
      <dc:creator>rahulroy_splunk</dc:creator>
      <dc:date>2014-04-29T21:01:35Z</dc:date>
    </item>
  </channel>
</rss>

