<?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: help on a field renaming in a subsearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-field-renaming-in-a-subsearch/m-p/467130#M191865</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;   index=master-data-lookups sourcetype="itop:view_splunk_assets" |rename HOSTNAME as host|search [|inputlookup host.csv ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;should work but it might be expensive since it scans through all events and then apply the search for all the host names in the csv file &lt;/P&gt;

&lt;P&gt;Instead, you could use the first search and rename HOSTNAME to host as the final step (not sure about the use case though)&lt;/P&gt;</description>
    <pubDate>Mon, 02 Sep 2019 14:21:43 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2019-09-02T14:21:43Z</dc:date>
    <item>
      <title>help on a field renaming in a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-field-renaming-in-a-subsearch/m-p/467127#M191862</link>
      <description>&lt;P&gt;hello&lt;/P&gt;

&lt;P&gt;in my csv file I have a field called "host" and in my index a field called "HOSTNAME"&lt;BR /&gt;
its the same field and I have to rename it in order to be able to match the events&lt;BR /&gt;
but i dont understand why it works when I am doing this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[| inputlookup host.csv 
    | rename host as HOSTNAME ] index=master-data-lookups sourcetype="xx" 
| stats count by HOSTNAME
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and it doesnt works when I am doing?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    [| inputlookup host.csv] index=master-data-lookups sourcetype="xx" | rename HOSTNAME as host
    | stats count by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;thanks for your help&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 13:15:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-field-renaming-in-a-subsearch/m-p/467127#M191862</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-09-02T13:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: help on a field renaming in a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-field-renaming-in-a-subsearch/m-p/467128#M191863</link>
      <description>&lt;P&gt;@jip31,&lt;/P&gt;

&lt;P&gt;In your first search, you are selecting all entries from your csv file and renaming the field &lt;CODE&gt;host&lt;/CODE&gt; to &lt;CODE&gt;HOSTNAME&lt;/CODE&gt; before the comparison with the events from index which has HOSTNAME for the same field i.e HOSTNAME(csv)==HOSTNAME(index&lt;/P&gt;

&lt;P&gt;In your second search, you are trying to match host with HOSTNAME  and then renaming it after the comparison.&lt;BR /&gt;
i.e. host(csv)==HOSTNAME(index) which does not work&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 13:35:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-field-renaming-in-a-subsearch/m-p/467128#M191863</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-09-02T13:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: help on a field renaming in a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-field-renaming-in-a-subsearch/m-p/467129#M191864</link>
      <description>&lt;P&gt;OK. so for the second search, is there a way to rename the fields HOSTNAME by host before the comparison?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 13:41:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-field-renaming-in-a-subsearch/m-p/467129#M191864</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-09-02T13:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: help on a field renaming in a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-field-renaming-in-a-subsearch/m-p/467130#M191865</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;   index=master-data-lookups sourcetype="itop:view_splunk_assets" |rename HOSTNAME as host|search [|inputlookup host.csv ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;should work but it might be expensive since it scans through all events and then apply the search for all the host names in the csv file &lt;/P&gt;

&lt;P&gt;Instead, you could use the first search and rename HOSTNAME to host as the final step (not sure about the use case though)&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 14:21:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-field-renaming-in-a-subsearch/m-p/467130#M191865</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-09-02T14:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: help on a field renaming in a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-field-renaming-in-a-subsearch/m-p/467131#M191866</link>
      <description>&lt;P&gt;Thanks renjith&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 15:46:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-field-renaming-in-a-subsearch/m-p/467131#M191866</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-09-02T15:46:45Z</dc:date>
    </item>
  </channel>
</rss>

