<?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: Enhancing Data with Field Extraction and Automated Lookups in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Enhancing-Data-with-Field-Extraction-and-Automated-Lookups/m-p/656783#M226848</link>
    <description>&lt;P&gt;Based on your illustrated data, the id field seems to have a certain format that can help you extract only location. &amp;nbsp;For example,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=id "^[A-Z]{2}_(?&amp;lt;location&amp;gt;\D[^_]*)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;will give you&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;TD&gt;location&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EF_jblo_fdsfew42_sla&lt;/TD&gt;&lt;TD&gt;jblo&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EF_space_332312_sla&lt;/TD&gt;&lt;TD&gt;space&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EF_97324_pewpew_sla&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;If you can find the correct format and a regex that populates location only when the format is correct, you can use OUTPUTNEW feature in lookup. (Automatic lookup also has OUTPUTNEW feature; I believe it is default.) This way, you do not have to perform the field name acrobat.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Sep 2023 07:57:25 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2023-09-06T07:57:25Z</dc:date>
    <item>
      <title>Enhancing Data with Field Extraction and Automated Lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Enhancing-Data-with-Field-Extraction-and-Automated-Lookups/m-p/656407#M226720</link>
      <description>&lt;P&gt;Hello to all,&lt;BR /&gt;i have the following&amp;nbsp;Issue:&lt;BR /&gt;I receive logs from an older machine for which I cannot adjust the logging settings. When extracting data in Splunk, I encounter the following field and some values:&lt;BR /&gt;&lt;BR /&gt;id = EF_jblo_fdsfew42_sla&lt;BR /&gt;id = EF_space_332312_sla&lt;BR /&gt;id = EF_97324_pewpew_sla&lt;BR /&gt;&lt;BR /&gt;with a field extraction I then get my location from the id.&lt;BR /&gt;For example:&lt;/P&gt;&lt;P&gt;id = EF_jblo_fdsfew42_sla&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; location = jblo&lt;BR /&gt;id = EF_space_332312_sla&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; location = space&lt;BR /&gt;id = EF_97324_pewpew_sla&amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; location = 97324 &amp;lt;- where this is not a location here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I aim to replace the location using an automatic lookup based on the ID "EF_97324_pewpew_sla." Unfortunately, I encounter an issue where I either retrieve only the location from the table, &lt;STRONG&gt;omitting the rest&lt;/STRONG&gt;, or I only receive the values extracted from the field extraction.&lt;/P&gt;&lt;P&gt;I've reviewed the search sequence as per the documentation, ensuring that field extraction precedes lookup. However, I'm perplexed as to why it consistently erases all the values rather than just overwriting a single one. Is there an automated solution running in the background, similar to automatic lookup, that could resolve this?&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thought lookup:&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;ID&lt;/TD&gt;&lt;TD width="50%"&gt;Solution&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;EF_97324_pewpew_sla&lt;/TD&gt;&lt;TD width="50%"&gt;TSINOC&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My original concept was as follows:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Data is ingested into Splunk.&lt;/LI&gt;&lt;LI&gt;Using field extraction to extract the location from the ID.&lt;/LI&gt;&lt;LI&gt;For the IDs where I am aware that they do not contain any location information, I intend to replace the extracted value with the lookup data.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I wanted to run the whole thing in the "background" so that the users do not have to run it as a search string.&lt;/P&gt;&lt;P&gt;I also tried to use calculated fields&amp;nbsp; to build one from two fields, but since the calculation takes place before the lookup, this was unfortunately not possible.&lt;/P&gt;&lt;P&gt;Hope someone can help me.&lt;BR /&gt;Kind regards,&lt;BR /&gt;Flenwy&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 10:41:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Enhancing-Data-with-Field-Extraction-and-Automated-Lookups/m-p/656407#M226720</guid>
      <dc:creator>Flenwy</dc:creator>
      <dc:date>2023-09-01T10:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Enhancing Data with Field Extraction and Automated Lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Enhancing-Data-with-Field-Extraction-and-Automated-Lookups/m-p/656435#M226728</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;is it possible that you put all locations into this automatic lookup and use only it without any additional field extractions etc.?&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 13:29:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Enhancing-Data-with-Field-Extraction-and-Automated-Lookups/m-p/656435#M226728</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-09-01T13:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Enhancing Data with Field Extraction and Automated Lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Enhancing-Data-with-Field-Extraction-and-Automated-Lookups/m-p/656470#M226742</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Now, I aim to replace the location using an automatic lookup based on the ID "EF_97324_pewpew_sla." Unfortunately, I encounter an issue where I either retrieve only the location from the table, &lt;STRONG&gt;omitting the rest&lt;/STRONG&gt;, or I only receive the values extracted from the field extraction.&lt;/BLOCKQUOTE&gt;&lt;P&gt;I think you meant to say that your extraction populates location field with every id, even in those that do not contain location information. &amp;nbsp;Instead of creating a table with all possible id's, you want to use a sparsely populated lookup to selectively override "bad" location value in those events with "bad" id's. &amp;nbsp;Is this correct?&lt;/P&gt;&lt;P&gt;Let me restate the requirement as this: if a lookup value exists, you want it to take precedence over any value your field extraction populates; if a lookup value does not exist, use the extracted value.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SPL can use &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/ConditionalFunctions#coalesce.28.26lt.3Bvalues.26gt.3B.29" target="_blank" rel="noopener"&gt;coalesce&lt;/A&gt;&amp;nbsp;to signal precedence. &amp;nbsp;You need to name extraction and lookup fields differently. &amp;nbsp;Say, you name your extracted field &lt;U&gt;location_may_be_bad&lt;/U&gt;, and the lookup output field just &lt;U&gt;location&lt;/U&gt;, you can then use this to get the location&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval location = coalesce(location, location_may_be_bad)&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 19:56:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Enhancing-Data-with-Field-Extraction-and-Automated-Lookups/m-p/656470#M226742</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-09-01T19:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Enhancing Data with Field Extraction and Automated Lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Enhancing-Data-with-Field-Extraction-and-Automated-Lookups/m-p/656623#M226783</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt; Hello &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;thank you for your reply.&lt;BR /&gt;At the moment i use the "coalesce" to quick fix the issue but i think in the long run in will do implement the lookup solution.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you both for your help!&lt;BR /&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;Flenwy&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2023 07:36:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Enhancing-Data-with-Field-Extraction-and-Automated-Lookups/m-p/656623#M226783</guid>
      <dc:creator>Flenwy</dc:creator>
      <dc:date>2023-09-05T07:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Enhancing Data with Field Extraction and Automated Lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Enhancing-Data-with-Field-Extraction-and-Automated-Lookups/m-p/656625#M226784</link>
      <description>Nice to hear that you found solution or actually several. You should remember that with splunk there are almost always several ways to do things, not only one! When you need to select "the best" one, you should look performance etc. from job inspector to understand better how those are working.&lt;BR /&gt;Happy Splunking!</description>
      <pubDate>Tue, 05 Sep 2023 07:40:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Enhancing-Data-with-Field-Extraction-and-Automated-Lookups/m-p/656625#M226784</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-09-05T07:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Enhancing Data with Field Extraction and Automated Lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Enhancing-Data-with-Field-Extraction-and-Automated-Lookups/m-p/656783#M226848</link>
      <description>&lt;P&gt;Based on your illustrated data, the id field seems to have a certain format that can help you extract only location. &amp;nbsp;For example,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=id "^[A-Z]{2}_(?&amp;lt;location&amp;gt;\D[^_]*)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;will give you&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;TD&gt;location&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EF_jblo_fdsfew42_sla&lt;/TD&gt;&lt;TD&gt;jblo&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EF_space_332312_sla&lt;/TD&gt;&lt;TD&gt;space&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EF_97324_pewpew_sla&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;If you can find the correct format and a regex that populates location only when the format is correct, you can use OUTPUTNEW feature in lookup. (Automatic lookup also has OUTPUTNEW feature; I believe it is default.) This way, you do not have to perform the field name acrobat.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 07:57:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Enhancing-Data-with-Field-Extraction-and-Automated-Lookups/m-p/656783#M226848</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-09-06T07:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Enhancing Data with Field Extraction and Automated Lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Enhancing-Data-with-Field-Extraction-and-Automated-Lookups/m-p/656806#M226857</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;thank you for this idea.&lt;BR /&gt;Will try this soulution this week.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Flenwy&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 11:14:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Enhancing-Data-with-Field-Extraction-and-Automated-Lookups/m-p/656806#M226857</guid>
      <dc:creator>Flenwy</dc:creator>
      <dc:date>2023-09-06T11:14:08Z</dc:date>
    </item>
  </channel>
</rss>

