<?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: Extracting Field from 2 different events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extracting-Field-from-2-different-events/m-p/495529#M138134</link>
    <description>&lt;P&gt;The field extractor may not like the escaped quote.&lt;/P&gt;</description>
    <pubDate>Sat, 09 May 2020 00:02:28 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-05-09T00:02:28Z</dc:date>
    <item>
      <title>Extracting Field from 2 different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-Field-from-2-different-events/m-p/495526#M138131</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;

&lt;P&gt;I want to extract fields from the below events. The problem I'm facing is that the fields are not in harmony. For example, in event 1, "action" is the second last key however in event 2, it is the last one.&lt;/P&gt;

&lt;P&gt;Similarly, some of the fields that are available in event 2, do not exist in event 1.&lt;/P&gt;

&lt;P&gt;Can you guide me in extracting the fields from these events?&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Event 1&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Fri May 08 11:44:37 PDT 2020|{"timestamp":1588963477939,"caller":"xyz@abc","applicationId":null,"applicationName":null,"action":"LOGIN","message":"User [xyz@abc] logged in successfully"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Event 2&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Fri May 08 18:44:38 UTC 2020|{"timestamp":1588963478783,"caller":"xyz@abc","applicationId":20575244,"applicationName":"TIB_TST","entityType":"APPLICATION","entityId":20575244,"entityName":"TIB_TST","changes":[{"property":"name","value":"TIB_TST"}],"action":"OBJECT_CREATED"}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 May 2020 19:35:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-Field-from-2-different-events/m-p/495526#M138131</guid>
      <dc:creator>ralam</dc:creator>
      <dc:date>2020-05-08T19:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Field from 2 different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-Field-from-2-different-events/m-p/495527#M138132</link>
      <description>&lt;P&gt;The fields don't have to be in harmony.  You can use multiple &lt;CODE&gt;rex&lt;/CODE&gt; commands to get each one.  For example,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | rex "action\":\"(?&amp;lt;action&amp;gt;[^\"]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 May 2020 20:03:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-Field-from-2-different-events/m-p/495527#M138132</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-05-08T20:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Field from 2 different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-Field-from-2-different-events/m-p/495528#M138133</link>
      <description>&lt;P&gt;Thank you @richgalloway. I have always believed that the bigger question has always a smaller answer.&lt;BR /&gt;
Your answer solved my bigger issue. However, one small problem, using your method I extracted many fields but facing a weird issue with &lt;CODE&gt;"entityId":20575244&lt;/CODE&gt;. I used &lt;CODE&gt;"entityId\":(?&amp;lt;entityId&amp;gt;\d+)"&lt;/CODE&gt; for it which worked in search but the same failed while applying in the Field Extractor application. It could not match to a single event.&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2020 21:07:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-Field-from-2-different-events/m-p/495528#M138133</guid>
      <dc:creator>ralam</dc:creator>
      <dc:date>2020-05-08T21:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Field from 2 different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-Field-from-2-different-events/m-p/495529#M138134</link>
      <description>&lt;P&gt;The field extractor may not like the escaped quote.&lt;/P&gt;</description>
      <pubDate>Sat, 09 May 2020 00:02:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-Field-from-2-different-events/m-p/495529#M138134</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-05-09T00:02:28Z</dc:date>
    </item>
  </channel>
</rss>

