<?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: Need Help with inputlookup within a search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-me-with-inputlookup-within-a-search/m-p/613519#M213231</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249573"&gt;@desperate&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can try below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=userdatabase "abc12345"
| lookup Lookup.csv code as opsID OUTPUT notes
| eval isPresent=if(isnotnull(notes), "YES", "NO")
| table username, isPresent&lt;/LI-CODE&gt;</description>
    <pubDate>Sun, 18 Sep 2022 10:32:46 GMT</pubDate>
    <dc:creator>scelikok</dc:creator>
    <dc:date>2022-09-18T10:32:46Z</dc:date>
    <item>
      <title>Could someone help me with inputlookup within a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-me-with-inputlookup-within-a-search/m-p/613518#M213230</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I am quite new to Splunk and now trying to create a dashboard panel using a query that does the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;pulls the required fields from an index based on textfield input&lt;/LI&gt;
&lt;LI&gt;checks on one specific field "opsID" from the index against a field "code" in a csv i uploaded&lt;/LI&gt;
&lt;LI&gt;if it is present in the csv, I just want to return a simple output that I could use to display in a table form&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The csv looks something like this:&lt;/P&gt;
&lt;PRE&gt;code, notes&lt;BR /&gt;123, User&lt;BR /&gt;456, Admin&lt;BR /&gt;789, User&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example of my query:&lt;/P&gt;
&lt;PRE&gt;index=userdatabase "abc12345"&lt;BR /&gt;| eval abc=[|inputlookup Lookup.csv | where code=opsID| fields notes]&lt;BR /&gt;| eval isPresent=if(abc!="", YES, NO)&lt;BR /&gt;| table username, isPresent&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However I am getting errors like&amp;nbsp;&lt;SPAN&gt;Error in 'eval' command: The expression is malformed. An unexpected character is reached at ')'. I tried for a few days can't seem to figure it out my mistake, hence hoping for some help over my basic question.. I got a feeling my logic could be wrong to begin with&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Sep 2022 23:46:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-me-with-inputlookup-within-a-search/m-p/613518#M213230</guid>
      <dc:creator>desperate</dc:creator>
      <dc:date>2022-09-18T23:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with inputlookup within a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-me-with-inputlookup-within-a-search/m-p/613519#M213231</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249573"&gt;@desperate&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can try below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=userdatabase "abc12345"
| lookup Lookup.csv code as opsID OUTPUT notes
| eval isPresent=if(isnotnull(notes), "YES", "NO")
| table username, isPresent&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 18 Sep 2022 10:32:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-me-with-inputlookup-within-a-search/m-p/613519#M213231</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2022-09-18T10:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with inputlookup within a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-me-with-inputlookup-within-a-search/m-p/613520#M213232</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249573"&gt;@desperate&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you should read the documentation about lookup command at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.1/SearchReference/Lookup" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.1/SearchReference/Lookup&lt;/A&gt;&amp;nbsp;and it could be a good idea to follow the Splunk Search Tutorial to better learn abou SPL &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/WelcometotheSearchTutorial" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/WelcometotheSearchTutorial&lt;/A&gt; .&lt;/P&gt;&lt;P&gt;Anyway, to solve your problem, please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=userdatabase "abc12345"
| lookup Lookup.csv code AS opsID OUTPUT notes
| where notes=*
| table code notes&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Sep 2022 10:36:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-me-with-inputlookup-within-a-search/m-p/613520#M213232</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-18T10:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with inputlookup within a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-me-with-inputlookup-within-a-search/m-p/613523#M213233</link>
      <description>&lt;P&gt;Thank you Sir&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;Appreciate the help, both of you are correct. I did not think toward this direction, i was over complicating my own query.&lt;/P&gt;&lt;P&gt;It works now. Once again appreciate the quick response&lt;/P&gt;</description>
      <pubDate>Sun, 18 Sep 2022 11:14:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-someone-help-me-with-inputlookup-within-a-search/m-p/613523#M213233</guid>
      <dc:creator>desperate</dc:creator>
      <dc:date>2022-09-18T11:14:45Z</dc:date>
    </item>
  </channel>
</rss>

