<?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: Add field from another index when key value has a different name in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-field-from-another-index-when-key-value-has-a/m-p/644545#M109713</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;The data shown was when I tabled the index and the other 3 fields to show the fields that I have and what I want to show.&lt;/P&gt;&lt;P&gt;I think there may be a parentheses missing from your stats command as there are 3 on left and only 2 on the right and I get an error message.&lt;/P&gt;</description>
    <pubDate>Wed, 24 May 2023 18:17:36 GMT</pubDate>
    <dc:creator>sergioleone</dc:creator>
    <dc:date>2023-05-24T18:17:36Z</dc:date>
    <item>
      <title>How to add field from another index when key value has a different name?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-field-from-another-index-when-key-value-has-a/m-p/644494#M109710</link>
      <description>&lt;P&gt;I have two indexes and need to pull the idfrom the second into the first. For example I have a log from each index in a table as follows. Index2 has every mail and id for a user meanwhile Index1 has the event data I will be using.&lt;/P&gt;
&lt;P&gt;Index: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; user: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mail: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;index1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name@gmail.com&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zxshbfbfve093ns&lt;BR /&gt;index2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name@gmail.com&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; abc123&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to pull the id field (abc123) and associate it to the event in index1 where &lt;A href="mailto:name@gmail.com" target="_blank" rel="noopener"&gt;name@gmail.com&lt;/A&gt; is matching in index2.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 15:13:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-field-from-another-index-when-key-value-has-a/m-p/644494#M109710</guid>
      <dc:creator>sergioleone</dc:creator>
      <dc:date>2023-05-24T15:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Add field from another index when key value has a different name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-field-from-another-index-when-key-value-has-a/m-p/644496#M109711</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257079"&gt;@sergioleone&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you're thinking to Splunk as a DB and to an index as a DB table, but Splunk isn't a DB and an index isn't a table!&lt;/P&gt;&lt;P&gt;In other words you can have etherogenous logs, different in structure and every thing, like the ones you have in the same or different indexes.&lt;/P&gt;&lt;P&gt;Logs are usually stored in an index when they have the same retention period and the same access rules not for their structure or information.&lt;/P&gt;&lt;P&gt;Anyway, you can present as results, without moving a log from an index to another using a search like the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index1 OR index=index2
| eval user=coalesce(user,mail)
| stats values(eval(if(index=index2),id,"") AS id BY user&lt;/LI-CODE&gt;&lt;P&gt;You could do the thing you would running the above search and saving results in a summary index, it isn't possible to move a part of events from an index to another, but why?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 15:16:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-field-from-another-index-when-key-value-has-a/m-p/644496#M109711</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-05-24T15:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: Add field from another index when key value has a different name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-field-from-another-index-when-key-value-has-a/m-p/644545#M109713</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;The data shown was when I tabled the index and the other 3 fields to show the fields that I have and what I want to show.&lt;/P&gt;&lt;P&gt;I think there may be a parentheses missing from your stats command as there are 3 on left and only 2 on the right and I get an error message.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 18:17:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-field-from-another-index-when-key-value-has-a/m-p/644545#M109713</guid>
      <dc:creator>sergioleone</dc:creator>
      <dc:date>2023-05-24T18:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Add field from another index when key value has a different name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-field-from-another-index-when-key-value-has-a/m-p/644573#M109716</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257079"&gt;@sergioleone&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;yes, you're right:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index1 OR index=index2
| eval user=coalesce(user,mail)
| stats values(eval(if(index=index2),id,"")) AS id BY user&lt;/LI-CODE&gt;&lt;P&gt;Anyway I hope to have cleared the different Splunk approach: all of us, coming from db development, passed throgh this mind change.&lt;/P&gt;&lt;P&gt;It's the same thing to use the join command: all the people from DB development use join command but join is a very slow command to use only when you haven't any other solution and with very few data, the correct solution is stats command.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 03:59:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-field-from-another-index-when-key-value-has-a/m-p/644573#M109716</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-05-25T03:59:40Z</dc:date>
    </item>
  </channel>
</rss>

