<?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: Using Field Aliases in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-Field-Aliases/m-p/134034#M36626</link>
    <description>&lt;P&gt;I had a similar requirement and following worked for me:&lt;/P&gt;

&lt;P&gt;Change&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sourcetype="My_Custom_sourcetype"  departure_city = return_city
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sourcetype="My_Custom_sourcetype" |where departure_city = return_city
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 08 Nov 2013 15:51:44 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2013-11-08T15:51:44Z</dc:date>
    <item>
      <title>Using Field Aliases</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Field-Aliases/m-p/134032#M36624</link>
      <description>&lt;P&gt;Just a small query: Lets say I need to find all values in one field in the access_logs matching values in some other fields:&lt;/P&gt;

&lt;P&gt;For example a search like this:&lt;/P&gt;

&lt;P&gt;Sourcetype="My_Custom_sourcetype"  departure_city = return_city ...and so on..&lt;/P&gt;

&lt;P&gt;We want to find all errors where the departure city and return city are the same.&lt;/P&gt;

&lt;P&gt;Above  we want to look at all values where dep_city  equal values in return_city field. In SQL we normally use aliases for such joins. I have tried using FIELDALIAS but it does not seem to work. Would appreciate any help. Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:13:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Field-Aliases/m-p/134032#M36624</guid>
      <dc:creator>olavo123</dc:creator>
      <dc:date>2020-09-28T15:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using Field Aliases</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Field-Aliases/m-p/134033#M36625</link>
      <description>&lt;P&gt;You should set what host/source/sourcetype you want to define your field alias&lt;BR /&gt;
Then set something like this:&lt;BR /&gt;
let say &lt;CODE&gt;departure_city&lt;/CODE&gt; is on host1 and &lt;CODE&gt;return_city&lt;/CODE&gt; is on host2&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=host1
departure_city = my_city_alias
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;create another one for return_city on host2&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=host2
return_city = my_city_alias
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in your search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=host1 OR host=host2 my_city_alias="Some City"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should return events with &lt;CODE&gt;departure_city&lt;/CODE&gt; and &lt;CODE&gt;return_city&lt;/CODE&gt; that are the same.&lt;BR /&gt;
Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2013 06:20:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Field-Aliases/m-p/134033#M36625</guid>
      <dc:creator>crt89</dc:creator>
      <dc:date>2013-11-08T06:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using Field Aliases</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Field-Aliases/m-p/134034#M36626</link>
      <description>&lt;P&gt;I had a similar requirement and following worked for me:&lt;/P&gt;

&lt;P&gt;Change&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sourcetype="My_Custom_sourcetype"  departure_city = return_city
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sourcetype="My_Custom_sourcetype" |where departure_city = return_city
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Nov 2013 15:51:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Field-Aliases/m-p/134034#M36626</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-11-08T15:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using Field Aliases</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Field-Aliases/m-p/134035#M36627</link>
      <description>&lt;P&gt;Thanks so much. You are awesome.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2013 16:20:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Field-Aliases/m-p/134035#M36627</guid>
      <dc:creator>olavo123</dc:creator>
      <dc:date>2013-11-08T16:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using Field Aliases</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Field-Aliases/m-p/134036#M36628</link>
      <description>&lt;P&gt;Thanks for the answer. This query is useful, if we are looking for pairs given a particular city, But in my case, I want to do it for all combinations.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2013 16:26:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Field-Aliases/m-p/134036#M36628</guid>
      <dc:creator>olavo123</dc:creator>
      <dc:date>2013-11-08T16:26:26Z</dc:date>
    </item>
  </channel>
</rss>

