<?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: Get all data even host name is getting changed while searching in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Get-all-data-even-host-name-is-getting-changed-while-searching/m-p/482027#M193180</link>
    <description>&lt;P&gt;Thanks but unfortunately it won't help me.&lt;BR /&gt;
since there can be multiple folders with same country/city/state&lt;/P&gt;</description>
    <pubDate>Wed, 11 Mar 2020 07:01:14 GMT</pubDate>
    <dc:creator>ips_mandar</dc:creator>
    <dc:date>2020-03-11T07:01:14Z</dc:date>
    <item>
      <title>Get all data even host name is getting changed while searching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-all-data-even-host-name-is-getting-changed-while-searching/m-p/482022#M193175</link>
      <description>&lt;P&gt;Hi &lt;BR /&gt;
I am monitoring log file from one folder and giving host field name as hostname.&lt;BR /&gt;
ex. I am monitoring C:\Logs\GTA(Brazil).*zip&lt;BR /&gt;
and here my host name is "GTA(Brazil)"&lt;BR /&gt;
but after some days I changed my folder name to GSTA(Brazil)&lt;BR /&gt;
Now I want whenever I am searching with index and new host name, I want to see old data as well(including new hostname data) with hostname- GTA(Brazil).&lt;BR /&gt;
For mapping I am creating one lookup which contain below information-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Name            new_name
GTTA(Brazil)    GTA(Brazil)
GTTA(Brazil)      GSTA(Brazil)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;now how macro should be created which will take input as new host name/ old host name and give results with combination of both.&lt;BR /&gt;
or is there any other way?&lt;BR /&gt;
Note- the folder name can get changed any time and I can update lookup with new name but while searching for data with host i want to get all data present within folder.&lt;BR /&gt;
Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 05:36:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-all-data-even-host-name-is-getting-changed-while-searching/m-p/482022#M193175</guid>
      <dc:creator>ips_mandar</dc:creator>
      <dc:date>2020-03-04T05:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Get all data even host name is getting changed while searching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-all-data-even-host-name-is-getting-changed-while-searching/m-p/482023#M193176</link>
      <description>&lt;P&gt;Create csv file as below:&lt;/P&gt;

&lt;P&gt;host&lt;BR /&gt;
GTA(Brazil)&lt;BR /&gt;
GSTA(Brazil)&lt;/P&gt;

&lt;P&gt;Use csv file lookup in search query as below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=INDEXNAME [| inputlookup filename.csv | format]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Mar 2020 06:59:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-all-data-even-host-name-is-getting-changed-while-searching/m-p/482023#M193176</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-04T06:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Get all data even host name is getting changed while searching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-all-data-even-host-name-is-getting-changed-while-searching/m-p/482024#M193177</link>
      <description>&lt;P&gt;@manjunathmeti, My Bad! sorry I haven't mentioned that I have multiple folders under Logs folder which I am monitoring and any folders name may renamed under log folder and I want to get results of all data contain within that folder.&lt;BR /&gt;
ex. Folder structure is like - &lt;BR /&gt;
Logs&amp;gt;&amp;gt;GTA(Brazil)&lt;BR /&gt;
Logs&amp;gt;&amp;gt;MTA(UK)&lt;BR /&gt;
Logs&amp;gt;&amp;gt;ATD(USA)&lt;/P&gt;

&lt;P&gt;and If GTA(Brazil) folder name is changed then while searching with new name GSTA(Brazil) I want old data from host GTA(Brazil)  as well but not from any other folders like MTA(UK) or ATD(USA).&lt;BR /&gt;
Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 07:18:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-all-data-even-host-name-is-getting-changed-while-searching/m-p/482024#M193177</guid>
      <dc:creator>ips_mandar</dc:creator>
      <dc:date>2020-03-04T07:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Get all data even host name is getting changed while searching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-all-data-even-host-name-is-getting-changed-while-searching/m-p/482025#M193178</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/95326"&gt;@ips_mandar&lt;/a&gt; ,&lt;/P&gt;

&lt;P&gt;There are many was to index and segregate data while indexing it.&lt;BR /&gt;
- If all the files from the folder are same type, than create a new sourcetype for the data and index data to the particular sourcetype created for GTA/GSTA(Brazil)/MTA(UK)/ATD(USA). Than you can search for the particular sourcetype and Splunk will return events from old and new host names.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index_name sourcetype=&amp;lt;your_sourcetype&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Now, if the country name part is going to be constant even after folder name changed, than you can simply search for host name containing the country name.&lt;/P&gt;

&lt;P&gt;index=index_name souretype=sourcetype_name host=&lt;EM&gt;brazil&lt;/EM&gt;&lt;BR /&gt;
There are many other possible ways, but it all depends on your environment.&lt;BR /&gt;
If folder is having multiple types of log files and all them are getting indexed to different index &amp;amp; sourcetype than it will make it very complex scenario.&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Regarding creating &lt;CODE&gt;macros&lt;/CODE&gt; following reference will help (if the above options solves your problem, create the macro of base search query)&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/Knowledge/Definesearchmacros" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.2/Knowledge/Definesearchmacros&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/Knowledge/Searchmacroexamples" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.2/Knowledge/Searchmacroexamples&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;accept &amp;amp; upvote the answer if ti helps.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:27:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-all-data-even-host-name-is-getting-changed-while-searching/m-p/482025#M193178</guid>
      <dc:creator>gaurav_maniar</dc:creator>
      <dc:date>2020-09-30T04:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Get all data even host name is getting changed while searching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-all-data-even-host-name-is-getting-changed-while-searching/m-p/482026#M193179</link>
      <description>&lt;P&gt;Then you should use calculated field. Add below configuration in props.conf on search head.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[SOURCETYPE_NAME]
EVAL-host = if(host=="GTA(Brazil)", "GSTA(Brazil)", host)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can create same from search head UI.&lt;BR /&gt;
1. Select &lt;STRONG&gt;Settings&lt;/STRONG&gt; &amp;gt; &lt;STRONG&gt;Fields&lt;/STRONG&gt;.&lt;BR /&gt;
2. Select &lt;STRONG&gt;Calculated Fields&lt;/STRONG&gt; &amp;gt; &lt;STRONG&gt;New Calculated Field&lt;/STRONG&gt;.&lt;BR /&gt;
3. Select the app that will use the calculated field.&lt;BR /&gt;
4. Select sourcetype to apply to the calculated field and specify a name.&lt;BR /&gt;
5. Name the resultant calculated field: host&lt;BR /&gt;
6. Define the eval expression: if(host=="GTA(Brazil)", "GSTA(Brazil)", host)&lt;BR /&gt;
7. Save and change permissions to other apps and roles.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 13:26:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-all-data-even-host-name-is-getting-changed-while-searching/m-p/482026#M193179</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-04T13:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Get all data even host name is getting changed while searching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-all-data-even-host-name-is-getting-changed-while-searching/m-p/482027#M193180</link>
      <description>&lt;P&gt;Thanks but unfortunately it won't help me.&lt;BR /&gt;
since there can be multiple folders with same country/city/state&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2020 07:01:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-all-data-even-host-name-is-getting-changed-while-searching/m-p/482027#M193180</guid>
      <dc:creator>ips_mandar</dc:creator>
      <dc:date>2020-03-11T07:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Get all data even host name is getting changed while searching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-all-data-even-host-name-is-getting-changed-while-searching/m-p/482028#M193181</link>
      <description>&lt;P&gt;Thanks but unfortunately it won't help me.&lt;BR /&gt;
Since it will change host name at search time but in my case user require to search with old/new folder name as host name and he should get all results contained in a folder.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2020 07:03:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-all-data-even-host-name-is-getting-changed-while-searching/m-p/482028#M193181</guid>
      <dc:creator>ips_mandar</dc:creator>
      <dc:date>2020-03-11T07:03:33Z</dc:date>
    </item>
  </channel>
</rss>

