<?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: What is the best concept for enrichment from multiply columns through multiple indices within one SPL? in Splunk Enterprise Security</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/What-is-the-best-concept-for-enrichment-from-multiply-columns/m-p/499720#M8739</link>
    <description>&lt;P&gt;Hi, @grobendg &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=A OR index=B OR (index=Z BAD)
|eval src=coalesce(src,srcip,Z_BAD_SRC)
|eval User=coalesce(User1,User2)
|stats values(User) as EnrichmentUser count(eval(index=="Z")) as flag by src
|where flag==1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think this is the solution for the original purpose.&lt;BR /&gt;
Please ask other questions again.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2019 11:06:36 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2019-12-06T11:06:36Z</dc:date>
    <item>
      <title>What is the best concept for enrichment from multiply columns through multiple indices within one SPL?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/What-is-the-best-concept-for-enrichment-from-multiply-columns/m-p/499715#M8734</link>
      <description>&lt;P&gt;I want to enrich my resultset from one SPL with multiply columns from other fields.&lt;BR /&gt;
&lt;STRONG&gt;I know map or joins can be used.&lt;/STRONG&gt; &lt;BR /&gt;
The problem is with map, it will limit the resultset further (instead of enrich) and hence you cannot use it mulitply times in one SPL.&lt;BR /&gt;
The problem is with join, its a lot of code to write for something as simple as that. Map would be just oneline.&lt;/P&gt;

&lt;P&gt;Let me phrase what I am trying to build. I am trying to build a generic macro or function or SPL which automatically enriches particular fields.&lt;/P&gt;

&lt;P&gt;Like for example, get username from IP.&lt;BR /&gt;
I have one username and two ways to the get IP.&lt;/P&gt;

&lt;P&gt;I cannot just do &lt;BR /&gt;
map search1 = "first spl1 enrich"&lt;BR /&gt;
map search2 = "first spl2 enrich"&lt;BR /&gt;
in the same SPL.&lt;/P&gt;

&lt;P&gt;search1 or search2 might be empty.&lt;/P&gt;

&lt;P&gt;What is the best concept for enrichment from multiply columns through multiple indices within one SPL?&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;What I am looking for is:&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;
(PseudoCode) &lt;/P&gt;

&lt;PRE&gt;
index=events BAD
| table _time BADFIELD EnrichmentUser
eval User1 =  | map search="search index=.... src="$BADFIELD$" | eval EnrichedUsername = user | sort -_time | head 1 | table EnrichedUsername"
eval User2 =  | map search="search index=.... src="$BADFIELD$" | eval EnrichedUsername = user | sort -_time | head 1 | table EnrichedUsername"
if User1 != EMPTY
  EnrichmentUser = User1
if User2 != EMPTY
  EnrichmentUser = User2
| table _time EnrichmentUser
&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;How do I achieve this with SPL ?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 14:01:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/What-is-the-best-concept-for-enrichment-from-multiply-columns/m-p/499715#M8734</guid>
      <dc:creator>grobendg</dc:creator>
      <dc:date>2019-12-02T14:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best concept for enrichment from multiply columns through multiple indices within one SPL?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/What-is-the-best-concept-for-enrichment-from-multiply-columns/m-p/499716#M8735</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;(index=events OR index=user1_index OR index=user2_index ) BAD
| eval src=coalesce(src,BADFIELD)
| stats first(_time) as _time, values(eval(if(index=user1_index,user,NULL))) as User1, values(eval(if(index=user2_index,user,NULL))) as User2 by src
| eval EnrichmentUser = coalesce(User1, User2)
| table _time EnrichmentUser
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, @grobendg &lt;/P&gt;

&lt;P&gt;Maybe this is okay.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 20:04:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/What-is-the-best-concept-for-enrichment-from-multiply-columns/m-p/499716#M8735</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-02T20:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best concept for enrichment from multiply columns through multiple indices within one SPL?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/What-is-the-best-concept-for-enrichment-from-multiply-columns/m-p/499717#M8736</link>
      <description>&lt;P&gt;I am very unclear about exactly what you are trying to do but probably the way to do it is to create 2 separate searches.  The first one is scheduled to run every X-minutes and creates/trues-up a &lt;CODE&gt;time-based lookup&lt;/CODE&gt; mapping the 2 fields that change based on time (perhaps this is DHCP stuff?).  Then, access this through a &lt;CODE&gt;time-based lookup definition&lt;/CODE&gt; to enhance the original data set.  The second ad-hoc search leverages the &lt;CODE&gt;time-based lookup&lt;/CODE&gt; to figure out what the variable field mapping is based on the value of &lt;CODE&gt;_time&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;P.S. &lt;CODE&gt;eval EnrichedUsername = user | sort -_time | head 1&lt;/CODE&gt; is much more efficient as &lt;CODE&gt;sort 1 - _time | rename user AS EnrichedUsername&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 21:03:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/What-is-the-best-concept-for-enrichment-from-multiply-columns/m-p/499717#M8736</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-02T21:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best concept for enrichment from multiply columns through multiple indices within one SPL?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/What-is-the-best-concept-for-enrichment-from-multiply-columns/m-p/499718#M8737</link>
      <description>&lt;P&gt;This is getting on the right direction, getting everything than trying to filter down and adding all metadata meanwhile.&lt;BR /&gt;
| index Z BAD&lt;BR /&gt;
| table Z_BAD_SRC&lt;BR /&gt;
I've index A with field "User1", needs to be compared with A.src = Z_BAD_SRC&lt;BR /&gt;&lt;BR /&gt;
I've index B with field "User2", needs to be compared with B.srcip = Z_BAD_SRC  &lt;/P&gt;

&lt;P&gt;How can I do that with eval, when the field names are different?&lt;BR /&gt;
eval EnrichmentUser = coalesce(User1, User2, "unable to enrich")&lt;/P&gt;

&lt;P&gt;I am unable to do the upper comparision for relation to catch the correct matching events.&lt;BR /&gt;
The idea with the second guy posting is what I think splunk would like to do.&lt;/P&gt;

&lt;P&gt;The idea is the following, I want to write hundreds of different SPLs for cases Like:&lt;BR /&gt;
1) GetUserName FromIP&lt;BR /&gt;
2) GetMac FromIP&lt;BR /&gt;
3) GetASN FromIP&lt;BR /&gt;
etc.etc. you have thousands of "enrichments". But the enrichments come from various sources.&lt;/P&gt;

&lt;P&gt;How to build the perfect metadata model enrichment, without getting straight to Data-Models (because you cant just combine tham using field names, but rather you have to use relations, like time/relation/same text).&lt;/P&gt;

&lt;P&gt;I want to be able to have many enrichments SPLs which get additionall fields to existing saved-searches, on scale.&lt;/P&gt;

&lt;P&gt;Or better:&lt;BR /&gt;
How to built the best auto-enrichment Splunk saved-searches which are using enrichments from various hundreds of other saved-searches and allow for generic overall enrichment? I know some other Product can do that, But its another Product.&lt;/P&gt;

&lt;P&gt;Has someone done that with Splunk? Like build all the enrichments into that... Or better use sep. platform, e.g. because of the limited SPL language.&lt;/P&gt;

&lt;P&gt;Automatic Field Lookups are not the way to get, because of performance problems with replication of the knowledge bundle.&lt;/P&gt;

&lt;P&gt;How to build the best enrichment system/framework for Splunk ?&lt;BR /&gt;
I need to have many saved-searches being enriched, automatically via fields or via SPL changes.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:14:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/What-is-the-best-concept-for-enrichment-from-multiply-columns/m-p/499718#M8737</guid>
      <dc:creator>grobendg</dc:creator>
      <dc:date>2020-09-30T03:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best concept for enrichment from multiply columns through multiple indices within one SPL?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/What-is-the-best-concept-for-enrichment-from-multiply-columns/m-p/499719#M8738</link>
      <description>&lt;P&gt;I think the best would be to use DB Connect 3 with a separate platform.&lt;BR /&gt;
Anyone else has any ideas / tips ?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 15:51:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/What-is-the-best-concept-for-enrichment-from-multiply-columns/m-p/499719#M8738</guid>
      <dc:creator>grobendg</dc:creator>
      <dc:date>2019-12-03T15:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best concept for enrichment from multiply columns through multiple indices within one SPL?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/What-is-the-best-concept-for-enrichment-from-multiply-columns/m-p/499720#M8739</link>
      <description>&lt;P&gt;Hi, @grobendg &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=A OR index=B OR (index=Z BAD)
|eval src=coalesce(src,srcip,Z_BAD_SRC)
|eval User=coalesce(User1,User2)
|stats values(User) as EnrichmentUser count(eval(index=="Z")) as flag by src
|where flag==1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think this is the solution for the original purpose.&lt;BR /&gt;
Please ask other questions again.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 11:06:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/What-is-the-best-concept-for-enrichment-from-multiply-columns/m-p/499720#M8739</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-06T11:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best concept for enrichment from multiply columns through multiple indices within one SPL?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/What-is-the-best-concept-for-enrichment-from-multiply-columns/m-p/499721#M8740</link>
      <description>&lt;P&gt;Thank you very much, accepting the answer!!!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 11:15:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/What-is-the-best-concept-for-enrichment-from-multiply-columns/m-p/499721#M8740</guid>
      <dc:creator>grobendg</dc:creator>
      <dc:date>2019-12-09T11:15:32Z</dc:date>
    </item>
  </channel>
</rss>

