<?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 Purpose of the &amp;quot;AS&amp;quot; statement in SPLUNK in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Purpose-of-the-quot-AS-quot-statement-in-SPLUNK/m-p/372619#M165109</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;What is the purpose of the AS statement in splunk? &lt;/P&gt;

&lt;P&gt;I thought, when used, it creates an alias of a column/field as it does in SQL, however, I've found that when used in a lookup statement, it acts as a sort of comparison, for instance in the following query:&lt;/P&gt;

&lt;P&gt;index=web_proxy | lookup full_user_names.csv username AS local_user OUTPUTNEW first_name, last_name&lt;/P&gt;

&lt;P&gt;i thought username field would be renamed as"Local_user" because of the AS  statement, however, I've been told that the statement in this scenario checks to see if a value in local_user matches a value in username.&lt;/P&gt;

&lt;P&gt;Can someone explain to me what the function of this statement is?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 16:48:54 GMT</pubDate>
    <dc:creator>mahbs</dc:creator>
    <dc:date>2020-09-29T16:48:54Z</dc:date>
    <item>
      <title>Purpose of the "AS" statement in SPLUNK</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Purpose-of-the-quot-AS-quot-statement-in-SPLUNK/m-p/372619#M165109</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;What is the purpose of the AS statement in splunk? &lt;/P&gt;

&lt;P&gt;I thought, when used, it creates an alias of a column/field as it does in SQL, however, I've found that when used in a lookup statement, it acts as a sort of comparison, for instance in the following query:&lt;/P&gt;

&lt;P&gt;index=web_proxy | lookup full_user_names.csv username AS local_user OUTPUTNEW first_name, last_name&lt;/P&gt;

&lt;P&gt;i thought username field would be renamed as"Local_user" because of the AS  statement, however, I've been told that the statement in this scenario checks to see if a value in local_user matches a value in username.&lt;/P&gt;

&lt;P&gt;Can someone explain to me what the function of this statement is?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:48:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Purpose-of-the-quot-AS-quot-statement-in-SPLUNK/m-p/372619#M165109</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2020-09-29T16:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Purpose of the "AS" statement in SPLUNK</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Purpose-of-the-quot-AS-quot-statement-in-SPLUNK/m-p/372620#M165110</link>
      <description>&lt;P&gt;It just specifies a field that matches the lookup table.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;lookup-field&amp;gt; [AS &amp;lt;event-field&amp;gt;]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;EX.&lt;BR /&gt;
    index=web_proxy|rename local_user as username &lt;BR /&gt;
    | lookup full_user_names.csv username OUTPUTNEW first_name, last_name&lt;/P&gt;

&lt;P&gt;EX.&lt;BR /&gt;
   index=web_proxy&lt;BR /&gt;
    | lookup full_user_names.csv username as local_user  OUTPUTNEW first_name, last_name,username &lt;BR /&gt;
    |table  local_user ,username,first_name, last_name&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:48:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Purpose-of-the-quot-AS-quot-statement-in-SPLUNK/m-p/372620#M165110</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2020-09-29T16:48:57Z</dc:date>
    </item>
  </channel>
</rss>

