<?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: How to extract only unique email ID's from a detailed log in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251640#M75214</link>
    <description>&lt;P&gt;Replace the &lt;CODE&gt;table&lt;/CODE&gt; command with &lt;CODE&gt;timechart&lt;/CODE&gt; to get time on the x-axis and you can do a &lt;CODE&gt;count&lt;/CODE&gt; to get Y-axis.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jul 2016 03:45:24 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-07-12T03:45:24Z</dc:date>
    <item>
      <title>How to extract only unique email ID's from a detailed log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251633#M75207</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;Here is a sample log:&lt;/P&gt;

&lt;P&gt;2016-07-11 16:19:52,689 [9] INFO  AdidasCoach.EmailProcessorConsumer.EmailProcessorConsumer - Request Id = 4bfb6032-a3bc-4a70-b4d4-5bc1aef91bdd, &lt;BR /&gt;
Identity = NONE for message: Start processing a new mail request. -- Input mailConfig = [{"From":null,"ReplayToUserMailAddress":null,&lt;BR /&gt;
"To":["&lt;STRONG&gt;&lt;A href="mailto:salsakid1@gmail.com"&gt;salsakid1@gmail.com&lt;/A&gt;&lt;/STRONG&gt;"],"Subject":null,"Body":null,"Attachments":null,"TemplateName":"BulkImportEmailTemplate","LocaleCode":"com",&lt;BR /&gt;
"TemplateVars":{"TitleContent":"Bulk Import","visitmiCoach":"VISIT miCoach ","Url":"&lt;A href="https://micoach.adidas.com%22,%22FirstName%22:%22"&gt;https://micoach.adidas.com","FirstName":"&lt;/A&gt;",&lt;BR /&gt;
"LastName":"","ImportResults":"\u003ctable style=\u0027font-family=arial; font-size=11px;\u0027\u003e\u003cthead\u003e\u003ctr &lt;BR /&gt;
style=\u0027background: #007FC5;\u0027\u003e\u003cth style=\u0027text-align: left; color: white; width: 64%; padding: 5px 5px; &lt;BR /&gt;
font-family: arial;font-size:12px;\u0027\u003eFile name\u003c/th\u003e\u003cth style=\u0027text-align: left; color: white; &lt;BR /&gt;
width: 36%; padding: 5px 5px; font-family: arial;font-size:12px;\u0027\u003eStatus\u003c/th\u003e\u003cth style=\u0027text-align: &lt;BR /&gt;
left; color: white; font-family: arial;font-size:12px;\u0027\u003e\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody &lt;BR /&gt;
class=\u0027bulk-import-items\u0027\u003e\u003ctr style=\u0027height: auto;\u0027\u003e\u003ctd style=\u0027width: 64%; &lt;BR /&gt;
padding: 5px 5px; font-family: arial;font-size:12px;\u0027\u003e2016-04-23 538287665 Running Polar.tcx\u003c/td\u003e\u003ctd &lt;BR /&gt;
style=\u0027width: 36%; padding: 5px 5px; font-family: arial;font-size:12px;\u0027\u003e\u003cspan style=\u0027color: red;; &lt;BR /&gt;
padding: 5px 5px; font-family: arial;font-size:12px;\u0027*&lt;EM&gt;u003eWorkout already imported&lt;/EM&gt;*\u003c/span\u003e\u003c/td\u003e\u003ctd &lt;/P&gt;

&lt;P&gt;Each time user performs any duplicate workout upload, this kind of event gets generated and stored in our logs.&lt;/P&gt;

&lt;P&gt;Here, we see nearly 10 events generating in the logs for each user.&lt;/P&gt;

&lt;P&gt;Now the requirement is &lt;/P&gt;

&lt;P&gt;1) to extract the unique list of email ID's from the log.&lt;BR /&gt;
2) representing the data in a graphical format (currently i managed to create a dashboard with event data only visible on panel)&lt;/P&gt;

&lt;P&gt;Can you please assist me. &lt;/P&gt;

&lt;P&gt;Many Thanks,&lt;BR /&gt;
Vasu&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 15:26:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251633#M75207</guid>
      <dc:creator>vasuit1242</dc:creator>
      <dc:date>2016-07-11T15:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only unique email ID's from a detailed log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251634#M75208</link>
      <description>&lt;P&gt;Does (in this case) "&lt;A href="mailto:salsakid1@gmail.com"&gt;salsakid1@gmail.com&lt;/A&gt;" show up as a field, like "email_address" or "to" or something?  Or does it only show up in the raw text as above?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 17:46:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251634#M75208</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-07-11T17:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only unique email ID's from a detailed log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251635#M75209</link>
      <description>&lt;P&gt;Very similar case at &lt;A href="https://answers.splunk.com/answers/172037/regex-to-match-email-id-anywhere-in-raw-log.html"&gt;Regex to match email id anywhere in raw log&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;MuS suggested - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; your base search | rex "(\'((\d{1,3}\.){3}\d{1,3})\'\,\s\')((?&amp;lt;sessionID&amp;gt;[\w\d]+)\'|(?&amp;lt;email&amp;gt;[\w\d\.\-]+\@[\w\d\.]+))" | table sessionID, email
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Jul 2016 18:02:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251635#M75209</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2016-07-11T18:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only unique email ID's from a detailed log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251636#M75210</link>
      <description>&lt;P&gt;This should extract any email id.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.... | rex "\b(?&amp;lt;emailid&amp;gt;[A-Za-z0-9\._\-\%\+]+\@[A-Za-z0-9\.\-\_]+)\b" | dedup emailid | table emailid
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For requirement number 2, what do you mean by graphical format?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 18:04:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251636#M75210</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-11T18:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only unique email ID's from a detailed log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251637#M75211</link>
      <description>&lt;P&gt;Your request #2 is rather vague, perhaps a better description of what you want may help.&lt;/P&gt;

&lt;P&gt;But, to your first question...&lt;/P&gt;

&lt;P&gt;First, you'll probably want to return only the logs with the "Workout already imported" string in it.  Unfortunately, because of the preceding and trailing characters (and possibly some copy-n-paste issues), you'll have to fiddle with this a bit.  You can try  adding the following pieces to your base search (the &lt;CODE&gt;...&lt;/CODE&gt; in the below, like &lt;CODE&gt;index=blah sourcetype=blech&lt;/CODE&gt; &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... "Workout already imported" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... "u003eWorkout already imported"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(I &lt;EM&gt;think&lt;/EM&gt; the asterisk character will be a minor breaker, so it should "split" the big string up at those points to let you search on it).&lt;/P&gt;

&lt;P&gt;If all else fails, for now you can use the very inefficient &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... "*Workout already imported*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In any case, you should have at the end of that just a pile of the duplicated records.&lt;/P&gt;

&lt;P&gt;So, once you have that, let's rex that into a field so you can do things with it.  If you append to the end of the search that returns the above logs the following, this should get you a new field called &lt;CODE&gt;email_address&lt;/CODE&gt;.  If you already have such a field, ignore this part and just use the fieldname you already have in the NEXT piece of code.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "\"To\":\[\"(?&amp;lt;email_address&amp;gt;[^\"]*)\"\]"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After that, you should have the &lt;CODE&gt;email_address&lt;/CODE&gt; field, so let's now do what you need to do.  &lt;/P&gt;

&lt;P&gt;My first thought on getting your distinct addresses - and there's all sorts of options for this - is to just do something simple like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "\"To\":\[\"(?&amp;lt;email_address&amp;gt;[^\"]*)\"\]" | dedup email_address | table email_address
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let us know how it goes!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 18:08:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251637#M75211</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-07-11T18:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only unique email ID's from a detailed log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251638#M75212</link>
      <description>&lt;P&gt;There is a filed already for this but it is not only representing this one, but a lengthy text is inside the field.&lt;/P&gt;

&lt;P&gt;Is there any way that i can upload the exported data from Splunk for this?&lt;/P&gt;

&lt;P&gt;Please suggest.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 02:14:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251638#M75212</guid>
      <dc:creator>vasuit1242</dc:creator>
      <dc:date>2016-07-12T02:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only unique email ID's from a detailed log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251639#M75213</link>
      <description>&lt;P&gt;i just copy pasted this line: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "\b(?[A-Za-z0-9\._\-\%\+]+\@[A-Za-z0-9\.\-\_]+)\b" | dedup emailid | table emailid
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to my existing search string. Wow Super it exactly extracted the last 24 hours data of unique email ID's.&lt;/P&gt;

&lt;P&gt;Many Thanks for this quick help. Is there any way to represent the data in line format? &lt;IMG src="http://%E2%80%AAC:Usersvasu_parvathamDesktopCapture.JPG" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Currently the data is being represented in just a raw format. We shall use this graphical data (X-axis - Date and Y-axis number of duplicate workout uploads count).&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 02:35:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251639#M75213</guid>
      <dc:creator>vasuit1242</dc:creator>
      <dc:date>2016-07-12T02:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only unique email ID's from a detailed log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251640#M75214</link>
      <description>&lt;P&gt;Replace the &lt;CODE&gt;table&lt;/CODE&gt; command with &lt;CODE&gt;timechart&lt;/CODE&gt; to get time on the x-axis and you can do a &lt;CODE&gt;count&lt;/CODE&gt; to get Y-axis.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 03:45:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251640#M75214</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-12T03:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only unique email ID's from a detailed log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251641#M75215</link>
      <description>&lt;P&gt;Thanks Sundaresh. &lt;/P&gt;

&lt;P&gt;I replaced the table command with timechart, but the results are not showing up.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 05:08:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251641#M75215</guid>
      <dc:creator>vasuit1242</dc:creator>
      <dc:date>2016-07-12T05:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only unique email ID's from a detailed log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251642#M75216</link>
      <description>&lt;P&gt;I have enabled two panels in a single dashboard.&lt;/P&gt;

&lt;P&gt;Panel 1:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=project_micoach AND tag=micoach AND "u003eWorkout" NOT tag=stg NOT test1@gmail.com NOT test2@gmail.com NOT test3@gmail.com NOT test4@gmail.com NOT test5@gmail.com | rex "\b(?[A-Za-z0-9\._\-\%\+]+\@[A-Za-z0-9\.\-\_]+)\b" | table emailid | stats count by emailid
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Result: Showing the list of email ID's along with the event count (removed dedup to see the original count per user)&lt;/P&gt;

&lt;P&gt;Panel 2:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index = project_micoach AND tag = micoach AND "u003eWorkout" NOT tag = stg NOT test1@gmail.com NOT test2@gmail.com NOT test3@gmail.com NOT test4@gmail.com NOT test5@gmail.com | rex "\b(?[A-Za-z0-9\._\-\%\+]+\@[A-Za-z0-9\.\-\_]+)\b" | table emailid | stats count by emailid
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Result: Showing the events in a graphical format. X-axis: Email ID's and Y-axis: count of events for each email ID.&lt;/P&gt;

&lt;P&gt;Is there any way to get Date in the X-axis and count of events in the Y-axis?&lt;/P&gt;

&lt;P&gt;Please suggest.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 05:54:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251642#M75216</guid>
      <dc:creator>vasuit1242</dc:creator>
      <dc:date>2016-07-12T05:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only unique email ID's from a detailed log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251643#M75217</link>
      <description>&lt;P&gt;Great works Sundaresh Sir.. one question..&lt;BR /&gt;
may i know how this part works please.. (for grep'ing @gmail.com)&lt;BR /&gt;
&lt;STRONG&gt;\@[A-Za-z0-9.-_]&lt;/STRONG&gt;      -....  particularly the &lt;STRONG&gt;.-_]&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 15:07:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251643#M75217</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-07-12T15:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only unique email ID's from a detailed log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251644#M75218</link>
      <description>&lt;P&gt;@inventsekar If you visit &lt;A href="http://regex101.com/"&gt;http://regex101.com/&lt;/A&gt; you can paste the _raw event in the test string region and the regex I suggested in the regular expression text box. You will see on the right there is a detailed explanation on how the regex is applied.&lt;/P&gt;

&lt;P&gt;Hopefully that helps&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 15:22:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/251644#M75218</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-12T15:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only unique email ID's from a detailed log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/539095#M152478</link>
      <description>&lt;P&gt;It worked.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 06:54:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-unique-email-ID-s-from-a-detailed-log/m-p/539095#M152478</guid>
      <dc:creator>PradnyaGosavi</dc:creator>
      <dc:date>2021-02-09T06:54:24Z</dc:date>
    </item>
  </channel>
</rss>

