<?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: Efficiently Search All Email Logs For Earliest Occurrence of Email Domain in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Efficiently-Search-All-Email-Logs-For-Earliest-Occurrence-of/m-p/752014#M242576</link>
    <description>&lt;P&gt;Building a lookup is perhaps the easiest. &amp;nbsp;Assuming domain is already extracted, you could do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype = mailstuff domain=* earliest=0
| stats min(_time) as first_seen by domain
| output lookup DomainFirstAppeared&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Of course, you need to define lookup DomainFirstAppeared.&lt;/P&gt;&lt;P&gt;After this, you can add this field first_seen in any search using lookup command, like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype = mailstuff
| lookup DomainFirstAppeared domain&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Aug 2025 02:17:33 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2025-08-22T02:17:33Z</dc:date>
    <item>
      <title>Efficiently Search All Email Logs For Earliest Occurrence of Email Domain</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Efficiently-Search-All-Email-Logs-For-Earliest-Occurrence-of/m-p/752004#M242575</link>
      <description>&lt;P&gt;I'm building out a search to look through email logs. The main search is fine, but I'd like to add fields showing when an email domain was first seen on our network, whether that be yesterday or three years ago.&lt;BR /&gt;&lt;BR /&gt;I was initially considering some kind of sub-search but I'm not sure how much something like that would impact my search time wherein I'm searching through several years of data every time I run the search. The only fields I'd care about are the domain field and the _time field, so I could cut out the rest, but I don't think that'd be enough.&lt;BR /&gt;&lt;BR /&gt;In this instance, would it be better to setup an accelerated data model instead and have it update at an interval(once every four hours, maybe?)? Or some kind of lookup table, perhaps? I also considered summary indexing, but I don't know enough about the specific of that feature set to draw any conclusions.&lt;BR /&gt;&lt;BR /&gt;Just looking to see what my best option is~ I plan to pass this search to SOC analysts to help them search through email, hence it'd be a search run frequently.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 21:32:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Efficiently-Search-All-Email-Logs-For-Earliest-Occurrence-of/m-p/752004#M242575</guid>
      <dc:creator>dtaylor</dc:creator>
      <dc:date>2025-08-21T21:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Efficiently Search All Email Logs For Earliest Occurrence of Email Domain</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Efficiently-Search-All-Email-Logs-For-Earliest-Occurrence-of/m-p/752014#M242576</link>
      <description>&lt;P&gt;Building a lookup is perhaps the easiest. &amp;nbsp;Assuming domain is already extracted, you could do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype = mailstuff domain=* earliest=0
| stats min(_time) as first_seen by domain
| output lookup DomainFirstAppeared&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Of course, you need to define lookup DomainFirstAppeared.&lt;/P&gt;&lt;P&gt;After this, you can add this field first_seen in any search using lookup command, like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype = mailstuff
| lookup DomainFirstAppeared domain&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Aug 2025 02:17:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Efficiently-Search-All-Email-Logs-For-Earliest-Occurrence-of/m-p/752014#M242576</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2025-08-22T02:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Efficiently Search All Email Logs For Earliest Occurrence of Email Domain</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Efficiently-Search-All-Email-Logs-For-Earliest-Occurrence-of/m-p/752016#M242577</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/274960"&gt;@dtaylor&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think easiest approach could be use a summary index or a lookup table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eg. for lookup table&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=email
| stats earliest(_time) as first_seen by domain
| outputlookup domain_first_seen.csv&lt;/LI-CODE&gt;&lt;P&gt;Then in your main search add lookup or use appendcols/join if you are using summary index.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=email
| lookup domain_first_seen.csv domain OUTPUT first_seen&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Prewin&lt;BR /&gt;If this answer helped you, please consider marking it as the solution or giving a Karma. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Aug 2025 04:11:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Efficiently-Search-All-Email-Logs-For-Earliest-Occurrence-of/m-p/752016#M242577</guid>
      <dc:creator>PrewinThomas</dc:creator>
      <dc:date>2025-08-22T04:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Efficiently Search All Email Logs For Earliest Occurrence of Email Domain</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Efficiently-Search-All-Email-Logs-For-Earliest-Occurrence-of/m-p/752087#M242585</link>
      <description>&lt;P&gt;I ended up choosing a little of all options! Created an accelerated data model to gather the data then used tstats in a report to actually process the data. That report uses outputlookup to create a lookup file from the report and is scheduled to run every 15 minutes and update the CSV with new data.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Aug 2025 07:53:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Efficiently-Search-All-Email-Logs-For-Earliest-Occurrence-of/m-p/752087#M242585</guid>
      <dc:creator>dtaylor</dc:creator>
      <dc:date>2025-08-23T07:53:55Z</dc:date>
    </item>
  </channel>
</rss>

