<?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 Search if an URL contains a user field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-if-an-URL-contains-a-user-field/m-p/524667#M147982</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I made a search where I use a regular expression to extract the username from the email address because we noticed that a lot of phishing mails contain that pattern. The following line is the expression&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=receiver_email "(?&amp;lt;user&amp;gt;[a-zA-Z]+.[a-zA-Z]+)\@"&lt;/LI-CODE&gt;&lt;P&gt;Now I want to add the field "user" in a search query to very if in the content body of an email there is a URL with that field.&amp;nbsp;&lt;BR /&gt;the search line that I tried is&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| search content_body="&amp;lt;https://*user*&amp;gt;"&lt;/LI-CODE&gt;&lt;P&gt;Of course this only verifies is the content equals to the string "user" but I don't know how to change it to the field value.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So just as an example if the URL is&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;A part of the content body

https://someurl.com/idontknow/blabla&amp;lt;USER&amp;gt;blabla

The rest of the content body&lt;/LI-CODE&gt;&lt;P&gt;I should get a hit because the username is in that URL.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much,&lt;/P&gt;&lt;P&gt;Sasquatchatmars&lt;/P&gt;</description>
    <pubDate>Wed, 14 Oct 2020 15:19:00 GMT</pubDate>
    <dc:creator>Sasquatchatmars</dc:creator>
    <dc:date>2020-10-14T15:19:00Z</dc:date>
    <item>
      <title>Search if an URL contains a user field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-if-an-URL-contains-a-user-field/m-p/524667#M147982</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I made a search where I use a regular expression to extract the username from the email address because we noticed that a lot of phishing mails contain that pattern. The following line is the expression&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=receiver_email "(?&amp;lt;user&amp;gt;[a-zA-Z]+.[a-zA-Z]+)\@"&lt;/LI-CODE&gt;&lt;P&gt;Now I want to add the field "user" in a search query to very if in the content body of an email there is a URL with that field.&amp;nbsp;&lt;BR /&gt;the search line that I tried is&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| search content_body="&amp;lt;https://*user*&amp;gt;"&lt;/LI-CODE&gt;&lt;P&gt;Of course this only verifies is the content equals to the string "user" but I don't know how to change it to the field value.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So just as an example if the URL is&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;A part of the content body

https://someurl.com/idontknow/blabla&amp;lt;USER&amp;gt;blabla

The rest of the content body&lt;/LI-CODE&gt;&lt;P&gt;I should get a hit because the username is in that URL.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much,&lt;/P&gt;&lt;P&gt;Sasquatchatmars&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 15:19:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-if-an-URL-contains-a-user-field/m-p/524667#M147982</guid>
      <dc:creator>Sasquatchatmars</dc:creator>
      <dc:date>2020-10-14T15:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Search if an URL contains a user field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-if-an-URL-contains-a-user-field/m-p/524687#M147993</link>
      <description>&lt;P&gt;Try using &lt;FONT face="courier new,courier"&gt;where&lt;/FONT&gt; rather than &lt;FONT face="courier new,courier"&gt;search&lt;/FONT&gt;, like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval user="foo", content_body="&amp;lt;https://something.com/foo/otherstuff&amp;gt;"
| where match(content_body,"&amp;lt;https://.*".user.".*&amp;gt;")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 17:03:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-if-an-URL-contains-a-user-field/m-p/524687#M147993</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-10-14T17:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Search if an URL contains a user field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-if-an-URL-contains-a-user-field/m-p/524792#M148042</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;This was what I needed thank you!&lt;/P&gt;&lt;P&gt;Sasquatchatmars&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 08:06:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-if-an-URL-contains-a-user-field/m-p/524792#M148042</guid>
      <dc:creator>Sasquatchatmars</dc:creator>
      <dc:date>2020-10-15T08:06:50Z</dc:date>
    </item>
  </channel>
</rss>

