<?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: What can I use if I need to check for multiple values of a field in my search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346351#M159571</link>
    <description>&lt;P&gt;1) Put it in a csv file &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults 
| eval OpenedBy="user1 user2 user3 user4 user5 user6 user7" 
| makemv OpenedBy 
| mvexpand OpenedBy
| table OpenedBy
| outputcsv myOpenedByList.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2) Read in the csv file inside of braces &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; sourcetype=incident [ | inputcsv myOpenedByList.csv | table OpenedBy]
| chart count over assignmentGroup by status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Because of the braces, the implicit format command will convert the values to read...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; (openedBy="user1" OR openedBy="user2" OR openedBy="user3" OR 
  openedBy="user4" OR openedBy="user5" OR openedBy="user6" OR 
  openedBy="user7")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3)   To see how that implicit format command works, you can do it explicitly ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | inputcsv myOpenedByList.csv | table OpenedBy | format
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...or, just for fun, even like this ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | inputcsv myOpenedByList.csv | table OpenedBy | format "(" "squiggle" "squaggle" "argle" "bargle" ")"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 02 Aug 2017 23:00:43 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-08-02T23:00:43Z</dc:date>
    <item>
      <title>What can I use if I need to check for multiple values of a field in my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346350#M159570</link>
      <description>&lt;P&gt;I have a simple query like below, where I am looking for tickets created by a group of people and then passing it to a chart for visualization.&lt;/P&gt;

&lt;P&gt;sourcetype=incident (openedBy="user1" OR openedBy="user2" OR openedBy="user3" OR openedBy="user4" OR openedBy="user5" OR openedBy="user6" OR openedBy="user7") | chart count over assignmentGroup by status&lt;/P&gt;

&lt;P&gt;I would like to know if I can use some feature in splunk where I can store the complete openedBy part of the query and call it in my search. &lt;/P&gt;

&lt;P&gt;Please help..&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 19:39:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346350#M159570</guid>
      <dc:creator>ayushdimri</dc:creator>
      <dc:date>2017-08-02T19:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: What can I use if I need to check for multiple values of a field in my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346351#M159571</link>
      <description>&lt;P&gt;1) Put it in a csv file &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults 
| eval OpenedBy="user1 user2 user3 user4 user5 user6 user7" 
| makemv OpenedBy 
| mvexpand OpenedBy
| table OpenedBy
| outputcsv myOpenedByList.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2) Read in the csv file inside of braces &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; sourcetype=incident [ | inputcsv myOpenedByList.csv | table OpenedBy]
| chart count over assignmentGroup by status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Because of the braces, the implicit format command will convert the values to read...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; (openedBy="user1" OR openedBy="user2" OR openedBy="user3" OR 
  openedBy="user4" OR openedBy="user5" OR openedBy="user6" OR 
  openedBy="user7")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3)   To see how that implicit format command works, you can do it explicitly ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | inputcsv myOpenedByList.csv | table OpenedBy | format
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...or, just for fun, even like this ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | inputcsv myOpenedByList.csv | table OpenedBy | format "(" "squiggle" "squaggle" "argle" "bargle" ")"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Aug 2017 23:00:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346351#M159571</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-02T23:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: What can I use if I need to check for multiple values of a field in my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346352#M159572</link>
      <description>&lt;P&gt;Thank You for the reply...!&lt;/P&gt;

&lt;P&gt;Looks like I am missing something here... Below is what I did as per the answer posted. Let me know if am missing something.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Created a file - 'myopenedByList.csv' and added the below comment in the file.&lt;/LI&gt;
&lt;LI&gt;Added this file as a "Lookup table files"&lt;/LI&gt;
&lt;LI&gt;Added "Lookup definition" for the above file.&lt;/LI&gt;
&lt;LI&gt;Performed the query as per the direction below using "inputcsv"&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;But am getting "No results" as the return.  I know there are results to return, because when I do the standard search using "openedBy=user1" am getting the result.&lt;/P&gt;

&lt;P&gt;Please suggest if I am missing something here.&lt;/P&gt;

&lt;P&gt;Thanks again for your time..!!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 14:10:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346352#M159572</guid>
      <dc:creator>ayushdimri</dc:creator>
      <dc:date>2017-08-03T14:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: What can I use if I need to check for multiple values of a field in my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346353#M159573</link>
      <description>&lt;P&gt;Does the column name in myopenedByList.csv is openedBy? Do the values match exactly (no extra space before or after)?&lt;/P&gt;

&lt;P&gt;Another option would be (in case list of openedBy user list is small) to create search macro to store your OR clause.&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.1/Knowledge/Definesearchmacros"&gt;https://docs.splunk.com/Documentation/SplunkCloud/6.6.1/Knowledge/Definesearchmacros&lt;/A&gt;&lt;BR /&gt;
Macro name: &lt;CODE&gt;openedByFilter&lt;/CODE&gt;&lt;BR /&gt;
Macro definition: &lt;CODE&gt;(openedBy="user1" OR openedBy="user2" OR openedBy="user3" OR openedBy="user4" OR openedBy="user5" OR openedBy="user6" OR openedBy="user7")&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;Updated search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=incident `openedByFilter` | chart count over assignmentGroup by status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Aug 2017 14:27:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346353#M159573</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-03T14:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: What can I use if I need to check for multiple values of a field in my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346354#M159574</link>
      <description>&lt;P&gt;Thank You somesonei2&lt;/P&gt;

&lt;P&gt;Tried macro and it worked.!!&lt;/P&gt;

&lt;P&gt;Regarding the inputcsv approach, I do not have any column in the csv file. As suggested in the answer, I created the .csv file as below.&lt;/P&gt;

&lt;P&gt;|makeresults &lt;BR /&gt;
2. | eval OpenedBy="user1 user2 user3 user4 user5 user6 user7" &lt;BR /&gt;
3. | makemv OpenedBy &lt;BR /&gt;
4. | mvexpand OpenedBy&lt;BR /&gt;
5. | table OpenedBy&lt;BR /&gt;
6. | outputcsv myOpenedByList.csv&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 14:47:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346354#M159574</guid>
      <dc:creator>ayushdimri</dc:creator>
      <dc:date>2017-08-03T14:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: What can I use if I need to check for multiple values of a field in my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346355#M159575</link>
      <description>&lt;P&gt;Macro approach suggested by somesoni2 worked for me.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 14:48:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346355#M159575</guid>
      <dc:creator>ayushdimri</dc:creator>
      <dc:date>2017-08-03T14:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: What can I use if I need to check for multiple values of a field in my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346356#M159576</link>
      <description>&lt;P&gt;If you used the above query to generate the lookukp, it should've a column name openedBy. Try running following and paste the result with header here.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup LookupDefinitionYouCreated
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Aug 2017 15:02:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346356#M159576</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-03T15:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: What can I use if I need to check for multiple values of a field in my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346357#M159577</link>
      <description>&lt;P&gt;I've moved somesoni2's comment to answer.  Please accept it if your problem is solved.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 15:24:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346357#M159577</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-08-03T15:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: What can I use if I need to check for multiple values of a field in my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346358#M159578</link>
      <description>&lt;P&gt;|makeresults↕ &lt;/P&gt;

&lt;P&gt;|eval openedBy="rh1h mea7 esrs"&lt;BR /&gt;&lt;BR /&gt;
| makemv openedBy&lt;BR /&gt;&lt;BR /&gt;
| mvexpand openedBy&lt;BR /&gt;&lt;BR /&gt;
| table openedBy&lt;BR /&gt;&lt;BR /&gt;
| outputcsv myopenedByList.csv  &lt;/P&gt;

&lt;P&gt;This is the result am getting.. The first row is showing up as column.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 17:06:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346358#M159578</guid>
      <dc:creator>ayushdimri</dc:creator>
      <dc:date>2017-08-03T17:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: What can I use if I need to check for multiple values of a field in my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346359#M159579</link>
      <description>&lt;P&gt;Sorry I meant first row is showing up as header.. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 17:06:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-can-I-use-if-I-need-to-check-for-multiple-values-of-a-field/m-p/346359#M159579</guid>
      <dc:creator>ayushdimri</dc:creator>
      <dc:date>2017-08-03T17:06:33Z</dc:date>
    </item>
  </channel>
</rss>

