<?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 prepend a value to a field at search-time to sanitize malicious URLs? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-prepend-a-value-to-a-field-at-search-time-to-sanitize/m-p/217147#M63767</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;Error in 'SearchParser': The name 'http.hostname' is invalid. Macro and argument names may only include alphanumerics, '_' and '-'. 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 22 Jun 2016 20:41:25 GMT</pubDate>
    <dc:creator>JSkier</dc:creator>
    <dc:date>2016-06-22T20:41:25Z</dc:date>
    <item>
      <title>How to prepend a value to a field at search-time to sanitize malicious URLs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-prepend-a-value-to-a-field-at-search-time-to-sanitize/m-p/217144#M63764</link>
      <description>&lt;P&gt;I'd like to sanitize host names during search time in Splunk (IDS alerts), so users don't receive a hyperlink to the bad sites and the alerts don't get snagged by the mail filter. I'd like to keep the inline table results of the alerts for mobile users and general convenience. &lt;/P&gt;

&lt;P&gt;For example, &lt;A href="http://www.badsite.com"&gt;www.badsite.com&lt;/A&gt; is automatically hyperlinked in e-mail clients, so I'd like to prepend hxxp:// to the field so the sent alert message doesn't get hyperlink or dropped. By specifying a bogus protocol both fat mail client and mail scanner will pass the inline table without issue. &lt;/P&gt;

&lt;P&gt;I found something about appending in the community, but that just shows a blank field during search for me (even when I assign httphostname without a period). &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval http.hostname=http.hostname."hxxp://" |
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In theory, I'd like this to prepend and actually work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval http.hostname="hxxp://".http.hostname |
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm using Splunk 6.3.2 in a clustered Linux environment, any help is appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 20:25:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-prepend-a-value-to-a-field-at-search-time-to-sanitize/m-p/217144#M63764</guid>
      <dc:creator>JSkier</dc:creator>
      <dc:date>2016-06-22T20:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to prepend a value to a field at search-time to sanitize malicious URLs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-prepend-a-value-to-a-field-at-search-time-to-sanitize/m-p/217145#M63765</link>
      <description>&lt;P&gt;Try putting your field name with single quotes. Like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval http.hostname="hxxp://".`http.hostname`
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jun 2016 20:37:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-prepend-a-value-to-a-field-at-search-time-to-sanitize/m-p/217145#M63765</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-22T20:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to prepend a value to a field at search-time to sanitize malicious URLs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-prepend-a-value-to-a-field-at-search-time-to-sanitize/m-p/217146#M63766</link>
      <description>&lt;P&gt;Assuming that you have a field called &lt;CODE&gt;http.hostname&lt;/CODE&gt; then like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval "http.hostname" = "hxxp://" . $http.hostname$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or possibly this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field="http.hostname" mode=sed "s/^http:/hxxp:/"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jun 2016 20:38:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-prepend-a-value-to-a-field-at-search-time-to-sanitize/m-p/217146#M63766</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-22T20:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to prepend a value to a field at search-time to sanitize malicious URLs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-prepend-a-value-to-a-field-at-search-time-to-sanitize/m-p/217147#M63767</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Error in 'SearchParser': The name 'http.hostname' is invalid. Macro and argument names may only include alphanumerics, '_' and '-'. 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jun 2016 20:41:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-prepend-a-value-to-a-field-at-search-time-to-sanitize/m-p/217147#M63767</guid>
      <dc:creator>JSkier</dc:creator>
      <dc:date>2016-06-22T20:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to prepend a value to a field at search-time to sanitize malicious URLs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-prepend-a-value-to-a-field-at-search-time-to-sanitize/m-p/217148#M63768</link>
      <description>&lt;P&gt;This worked perfectly, thanks!&lt;BR /&gt;
    ... | eval "http.hostname" = "hxxp://" . $http.hostname$&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 20:43:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-prepend-a-value-to-a-field-at-search-time-to-sanitize/m-p/217148#M63768</guid>
      <dc:creator>JSkier</dc:creator>
      <dc:date>2016-06-22T20:43:34Z</dc:date>
    </item>
  </channel>
</rss>

