<?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 can I pass dynamic values to the IN operator? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/585083#M203809</link>
    <description>&lt;P&gt;This can be slightly simplified by renaming myField to query in the subsearch because the format command treats this as a special case and doesn't include the "query=" in the formatted string&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... myField IN (
[ search ... 
```We only need one field```
| fields myField 
```Remove duplicate values```
| dedup myField 
``` rename field to query
| rename myField as query
```Format the results using no delimeters```
| format mvsep="" "" "" "" "" "" "" ]
)&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 15 Feb 2022 07:09:55 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-02-15T07:09:55Z</dc:date>
    <item>
      <title>How can I pass dynamic values to the IN operator?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/585035#M203800</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;.... myField IN (&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[search ..| table myField])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Where the values passed to the IN operator will be calculate dynamically from another search&amp;nbsp;&lt;/P&gt;&lt;P&gt;But that returns&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Unable to parse the search: Right hand side of IN must be a collection of literals. '((myField = "123") OR (myField = "1234")&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can I do this?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 21:02:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/585035#M203800</guid>
      <dc:creator>yk010123</dc:creator>
      <dc:date>2022-02-14T21:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can I pass dynamic values to the IN operator?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/585046#M203801</link>
      <description>&lt;P&gt;Subsearches aren't designed to work with the IN operator since IN is relatively new.&amp;nbsp; We can make it work, however.&amp;nbsp; Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... myField IN (
[ search ... 
```We only need one field```
| fields myField 
```Remove duplicate values```
| dedup myField 
```Format the results using no delimeters```
| format mvsep="" "" "" "" "" "" "" 
```Remove "myField=" from the formatted string```
| eval search=replace(search, "myField =", "")
]&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 15 Feb 2022 01:27:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/585046#M203801</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-02-15T01:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: How can I pass dynamic values to the IN operator?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/585083#M203809</link>
      <description>&lt;P&gt;This can be slightly simplified by renaming myField to query in the subsearch because the format command treats this as a special case and doesn't include the "query=" in the formatted string&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... myField IN (
[ search ... 
```We only need one field```
| fields myField 
```Remove duplicate values```
| dedup myField 
``` rename field to query
| rename myField as query
```Format the results using no delimeters```
| format mvsep="" "" "" "" "" "" "" ]
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 15 Feb 2022 07:09:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/585083#M203809</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-02-15T07:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: How can I pass dynamic values to the IN operator?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/585268#M203889</link>
      <description>&lt;P&gt;Or you can simplify to this in most cases:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your-search&amp;gt; [search &amp;lt;the search you wish to write&amp;gt; | table myField]&lt;/LI-CODE&gt;&lt;P&gt;- As far as field name myField is common in both searches.&lt;/P&gt;&lt;P&gt;- Splunk will automatically add the &lt;STRONG&gt;IN&lt;/STRONG&gt; operator.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 06:16:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/585268#M203889</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-02-16T06:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can I pass dynamic values to the IN operator?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/585336#M203922</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/93915"&gt;@VatsalJagani&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;- Splunk will automatically add the &lt;STRONG&gt;IN&lt;/STRONG&gt; operator.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Not exactly.&amp;nbsp; Splunk will automatically convert the subsearch into a series of OR clauses, which is the same thing it does with the IN operator.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 12:54:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/585336#M203922</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-02-16T12:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I pass dynamic values to the IN operator?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/585390#M203951</link>
      <description>&lt;P&gt;Yeah, that is correct both will be converted to OR operators but those are one or the same thing. So to avoid confusion I generally say IN operator.&lt;/P&gt;&lt;P&gt;But thanks for clarification.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 16:11:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/585390#M203951</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-02-16T16:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: How can I pass dynamic values to the IN operator?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/667373#M228949</link>
      <description>&lt;P&gt;Incredible answer!&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2023 12:50:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/667373#M228949</guid>
      <dc:creator>lmonahan</dc:creator>
      <dc:date>2023-11-04T12:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: How can I pass dynamic values to the IN operator?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/667374#M228950</link>
      <description>&lt;P&gt;Another incredible answer!&amp;nbsp; These helped me a lot!&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2023 12:50:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-pass-dynamic-values-to-the-IN-operator/m-p/667374#M228950</guid>
      <dc:creator>lmonahan</dc:creator>
      <dc:date>2023-11-04T12:50:27Z</dc:date>
    </item>
  </channel>
</rss>

