<?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 combining fields from two log entries which have a common id that is named differently in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/combining-fields-from-two-log-entries-which-have-a-common-id/m-p/437659#M167663</link>
    <description>&lt;P&gt;Base, &lt;/P&gt;

&lt;P&gt;How can I combine two log entries that share a common ID when the field name of the ID is different between both entries?&lt;/P&gt;

&lt;P&gt;Currently I'm using re-name to change my field names into strings that don't contain "-" (eval seems to hate "-"),&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;rename v.my-very-long-field-name.rid AS rid&lt;BR /&gt;
then eval to give the unique field names a single name, and transact:&lt;/P&gt;

&lt;P&gt;eval request_id=if(isnull(rid), req, rid)&lt;BR /&gt;
transaction request_id  |&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Last thing: I table values from both log entries. Seems like it should work great... but... it doesn't. &lt;BR /&gt;
I end up with table entries containing values from 1 log entry or the other, not both. &lt;/P&gt;

&lt;P&gt;Help me Obi Wan...&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 21:06:17 GMT</pubDate>
    <dc:creator>dreeck</dc:creator>
    <dc:date>2020-09-29T21:06:17Z</dc:date>
    <item>
      <title>combining fields from two log entries which have a common id that is named differently</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combining-fields-from-two-log-entries-which-have-a-common-id/m-p/437659#M167663</link>
      <description>&lt;P&gt;Base, &lt;/P&gt;

&lt;P&gt;How can I combine two log entries that share a common ID when the field name of the ID is different between both entries?&lt;/P&gt;

&lt;P&gt;Currently I'm using re-name to change my field names into strings that don't contain "-" (eval seems to hate "-"),&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;rename v.my-very-long-field-name.rid AS rid&lt;BR /&gt;
then eval to give the unique field names a single name, and transact:&lt;/P&gt;

&lt;P&gt;eval request_id=if(isnull(rid), req, rid)&lt;BR /&gt;
transaction request_id  |&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Last thing: I table values from both log entries. Seems like it should work great... but... it doesn't. &lt;BR /&gt;
I end up with table entries containing values from 1 log entry or the other, not both. &lt;/P&gt;

&lt;P&gt;Help me Obi Wan...&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:06:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combining-fields-from-two-log-entries-which-have-a-common-id/m-p/437659#M167663</guid>
      <dc:creator>dreeck</dc:creator>
      <dc:date>2020-09-29T21:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: combining fields from two log entries which have a common id that is named differently</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combining-fields-from-two-log-entries-which-have-a-common-id/m-p/437660#M167664</link>
      <description>&lt;P&gt;Hi my very young padawan, &lt;/P&gt;

&lt;P&gt;as you did not provide enough sample data or your full query I have to write in pseudo code.&lt;BR /&gt;
What I will try is introduce you to subsearches. You can find more information about them here:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/latest/SearchTutorial/Useasubsearch" target="_blank"&gt;http://docs.splunk.com/Documentation/SplunkCloud/latest/SearchTutorial/Useasubsearch&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;index=logsource_A AND my-very-long-field-name.rid=* | rename my-very-long-field-name.rid AS rid&lt;BR /&gt;
| join rid [search index=logsource_B AND rid=*]&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:07:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combining-fields-from-two-log-entries-which-have-a-common-id/m-p/437660#M167664</guid>
      <dc:creator>horsefez</dc:creator>
      <dc:date>2020-09-29T21:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: combining fields from two log entries which have a common id that is named differently</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combining-fields-from-two-log-entries-which-have-a-common-id/m-p/437661#M167665</link>
      <description>&lt;P&gt;It would be helpful to see what you are doing with the data, other than "table". Maybe your use case can be done with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=A OR sourcetype=B
| rename your.very.long.field.name as rid
| eval request_id=coalesce(req, rid)
| stats &amp;lt;your logic&amp;gt; by request_id
| table your result
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Sep 2018 11:51:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combining-fields-from-two-log-entries-which-have-a-common-id/m-p/437661#M167665</guid>
      <dc:creator>knielsen</dc:creator>
      <dc:date>2018-09-04T11:51:02Z</dc:date>
    </item>
  </channel>
</rss>

