<?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 Passing lookup value to search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-value-to-search/m-p/679053#M232132</link>
    <description>&lt;P&gt;I have users.csv as a lookup file with almost 20K users.&amp;nbsp; I'm writing a query for authentication events for a specific time range for all these users.&amp;nbsp; CSV file has only one column with the email address of each user and the column header is email.&lt;/P&gt;
&lt;P&gt;1) Get the user email from the lookup user.csv file&lt;/P&gt;
&lt;P&gt;2) pass user email in the search&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) Authentication counts per day for specific time range.&lt;/P&gt;
&lt;P&gt;I don't have email as a field in the authentication event.&lt;/P&gt;
&lt;P&gt;. i can get USER-EMAIL in the authentication event using&amp;nbsp; formula&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Index="IndexName"| fields "_time", "eventType", "target{}.alternateId", "target{}.type" | 

| search "eventType" = "user.authentication.sso" | rename "target{}.alternateId" AS "targetId" | rename "target{}.type" AS "targetType" | eval "Application"=mvindex(targetId, mvfind(targetType, "AppInstance")) | eval "USER-EMAIL"=mvindex(targetId, mvfind(targetType, "AppUser")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;authentication event&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{"actor": {"id": "00u1p2k8w5CVuKgeq4h7", "type": "User", "alternateId": "USER-EMAIL", "displayName": "USER-NAME", "detailEntry": null}, "device": null, "authenticationContext": {"authenticationProvider": null, "credentialProvider": null, "credentialType": null, "issuer": null, "interface": null, "authenticationStep": 0}, "displayMessage": "User single sign on to app", "eventType": "user.authentication.sso", "outcome": {"result": "SUCCESS", "reason": null}, "published": "2024-02-20T22:25:18.552Z", "signOnMode": "OpenID Connect",}, "target": [{"id": "XXXXXXX", "type": "AppInstance", "alternateId": "APPLICATION-NAME": "OpenID Connect Client", "detailEntry": {"signOnModeType": "OPENID_CONNECT"}}, {"id": "YYYYYY", "type": "AppUser", "alternateId": "USER-EMAIL, "displayName": "USER-NAME, "detailEntry": null}]}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Index="indexName" "eventType" = "user.authentication.sso" [|inputlookup "users.csv"] &lt;/LI-CODE&gt;
&lt;P&gt;is not working.&lt;/P&gt;
&lt;P&gt;any help is appreciated.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Feb 2024 21:05:45 GMT</pubDate>
    <dc:creator>atul9771</dc:creator>
    <dc:date>2024-02-28T21:05:45Z</dc:date>
    <item>
      <title>Passing lookup value to search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-value-to-search/m-p/679053#M232132</link>
      <description>&lt;P&gt;I have users.csv as a lookup file with almost 20K users.&amp;nbsp; I'm writing a query for authentication events for a specific time range for all these users.&amp;nbsp; CSV file has only one column with the email address of each user and the column header is email.&lt;/P&gt;
&lt;P&gt;1) Get the user email from the lookup user.csv file&lt;/P&gt;
&lt;P&gt;2) pass user email in the search&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) Authentication counts per day for specific time range.&lt;/P&gt;
&lt;P&gt;I don't have email as a field in the authentication event.&lt;/P&gt;
&lt;P&gt;. i can get USER-EMAIL in the authentication event using&amp;nbsp; formula&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Index="IndexName"| fields "_time", "eventType", "target{}.alternateId", "target{}.type" | 

| search "eventType" = "user.authentication.sso" | rename "target{}.alternateId" AS "targetId" | rename "target{}.type" AS "targetType" | eval "Application"=mvindex(targetId, mvfind(targetType, "AppInstance")) | eval "USER-EMAIL"=mvindex(targetId, mvfind(targetType, "AppUser")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;authentication event&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{"actor": {"id": "00u1p2k8w5CVuKgeq4h7", "type": "User", "alternateId": "USER-EMAIL", "displayName": "USER-NAME", "detailEntry": null}, "device": null, "authenticationContext": {"authenticationProvider": null, "credentialProvider": null, "credentialType": null, "issuer": null, "interface": null, "authenticationStep": 0}, "displayMessage": "User single sign on to app", "eventType": "user.authentication.sso", "outcome": {"result": "SUCCESS", "reason": null}, "published": "2024-02-20T22:25:18.552Z", "signOnMode": "OpenID Connect",}, "target": [{"id": "XXXXXXX", "type": "AppInstance", "alternateId": "APPLICATION-NAME": "OpenID Connect Client", "detailEntry": {"signOnModeType": "OPENID_CONNECT"}}, {"id": "YYYYYY", "type": "AppUser", "alternateId": "USER-EMAIL, "displayName": "USER-NAME, "detailEntry": null}]}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Index="indexName" "eventType" = "user.authentication.sso" [|inputlookup "users.csv"] &lt;/LI-CODE&gt;
&lt;P&gt;is not working.&lt;/P&gt;
&lt;P&gt;any help is appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 21:05:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-value-to-search/m-p/679053#M232132</guid>
      <dc:creator>atul9771</dc:creator>
      <dc:date>2024-02-28T21:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Passing lookup value to search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-value-to-search/m-p/679057#M232136</link>
      <description>&lt;P&gt;First, thank you for presenting your use case with all necessary information. &amp;nbsp;As this forum can evidence, I am a strong advocate for not treating structured data as string. &amp;nbsp;But I will take a very intentional exception in your case because your data volume could be large. &amp;nbsp;Try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Index="indexName" "eventType" = "user.authentication.sso"
  [inputlookup "users.csv"
  | rename email AS search] &lt;/LI-CODE&gt;&lt;P&gt;Here, this is using the email field from the lookup as pure search terms in hope that there is no event commingled with multiple users' emails.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 21:01:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-value-to-search/m-p/679057#M232136</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-02-28T21:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Passing lookup value to search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-value-to-search/m-p/679059#M232138</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;SPAN&gt;, for your quick response.&amp;nbsp; Your query returned authentication events for the first user in the users.csv file.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can we modify the query to get the authentication events for all the users in the user.csv file?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 21:13:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-value-to-search/m-p/679059#M232138</guid>
      <dc:creator>atul9771</dc:creator>
      <dc:date>2024-02-28T21:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Passing lookup value to search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-value-to-search/m-p/679066#M232142</link>
      <description>&lt;P&gt;&lt;STRIKE&gt;Not sure why it only gives you one user. &amp;nbsp;But try these&amp;nbsp;&lt;/STRIKE&gt;My mistake.&amp;nbsp; To use the &lt;FONT face="courier new,courier"&gt;search&lt;/FONT&gt; meta-keyword, &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Format" target="_blank" rel="noopener"&gt;format&lt;/A&gt; is required. &amp;nbsp;Try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Index="indexName" "eventType" = "user.authentication.sso"
  [inputlookup "users.csv"
  | rename email AS search
  | format] &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Index="indexName" "eventType" = "user.authentication.sso"
  [inputlookup "users.csv"
  | stats values(email) AS search
  | format]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry about my mistake.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 01:42:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-value-to-search/m-p/679066#M232142</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-02-29T01:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Passing lookup value to search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-value-to-search/m-p/679076#M232146</link>
      <description>&lt;P&gt;Brilliant,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;. Both solutions work.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 00:26:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-value-to-search/m-p/679076#M232146</guid>
      <dc:creator>atul9771</dc:creator>
      <dc:date>2024-02-29T00:26:34Z</dc:date>
    </item>
  </channel>
</rss>

