<?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: remove the special character ' from beginning and end of the field value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311316#M161016</link>
    <description>&lt;P&gt;I believe that allowing EXTRACT to work after KV_MODE is intended to make some tweaks on the automatically extracted fields.&lt;/P&gt;</description>
    <pubDate>Thu, 25 May 2017 19:49:09 GMT</pubDate>
    <dc:creator>aakwah</dc:creator>
    <dc:date>2017-05-25T19:49:09Z</dc:date>
    <item>
      <title>remove the special character ' from beginning and end of the field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311304#M161004</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
   I am reeving the logs from email gateway and all the field values are between ' character and those are captured as part of field value. Below is the sample log.&lt;/P&gt;

&lt;P&gt;&amp;lt;22&amp;gt;May 21 14:16:30 meg234 : app='smtp', name='Email Status', policy_name='', dvc_host='', virtual_host='meg.test.com', event_id=50006, reason_id=77, direction=1, src_ip='1.1.1.1', src_host='meg.test.com', dest_ip='2.2.2.2', dest_host='', rhdr_ip='', is_primary_action=, scanner='', action='', status='Email Delivered', sender=, recipient='', msgid='5b69_036d_201e8739_1cef_495b_a267_8ce04d4b9c36', orig_msgid='&lt;A href="mailto:2ecf5795f6ea4e1ca81c732102316082@test.local" target="_blank"&gt;2ecf5795f6ea4e1ca81c732102316082@test.local&lt;/A&gt;', nrcpts=1, relay='', subject='sadeer Final', encryption_type='0', orig_subject='', orig_sender='', size=238141, attachments='Companytest.docx, test.xlsx', number_attachments=2, virus_name='', file_name='', spamscore=, spamthreshold=, spamrules='', URL='', contentrule='[]', content_terms='[]', tz='GMT', tz_offset='+0000', dlpfile='', dlprules='', dlpclassification='', dlpfileuploaded='', dlpfiledigest='', dlpfilesize='', iascore=, iathreshold=, ts_reputation_score=, ts_geo_location='', ts_ip_rep_status=, ts_hash_length=, ts_lookup_hash='', local-time='2017-05-21_14:16:23_GMT' scan-host-name='meg', scan-host-ip='1.1.1.1', host-name='meg234', host-domain-name='test.com', mac-address='00:00:00:34:79:45', product='FG (9.9) PM5600', user-name='test'&lt;/P&gt;

&lt;P&gt;All the captured field value including the special character &lt;STRONG&gt;'&lt;/STRONG&gt; as begging and end of the value.  I wan't to remove the special character '  from all the beginning and end of the value. of all the fields.&lt;BR /&gt;
help me on this.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:12:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311304#M161004</guid>
      <dc:creator>mustafag</dc:creator>
      <dc:date>2020-09-29T14:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: remove the special character ' from beginning and end of the field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311305#M161005</link>
      <description>&lt;P&gt;Just to add..&lt;BR /&gt;
When I am using the search with below, It's shows the special character ' removed. &lt;BR /&gt;
&lt;STRONG&gt;index =test | | rex mode=sed "s/'//g"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;but when I add the below in props.conf, special character are not removing.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;SEDCMD-RemoveSingleQuotes = s//'//g&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 11:47:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311305#M161005</guid>
      <dc:creator>mustafag</dc:creator>
      <dc:date>2017-05-25T11:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: remove the special character ' from beginning and end of the field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311306#M161006</link>
      <description>&lt;P&gt;During search, you can do it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | foreach * [rex field=&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; mode=sed "s/^'// s/'$//"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;During indexing, we will need to know how you are indexing your fields.&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 11:51:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311306#M161006</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-25T11:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: remove the special character ' from beginning and end of the field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311307#M161007</link>
      <description>&lt;P&gt;During the search, below command is working but I need to fix in props.conf .&lt;BR /&gt;
&lt;STRONG&gt;index =test | | rex mode=sed "s/'//g"&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 11:56:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311307#M161007</guid>
      <dc:creator>mustafag</dc:creator>
      <dc:date>2017-05-25T11:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: remove the special character ' from beginning and end of the field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311308#M161008</link>
      <description>&lt;P&gt;Your SEDCMD approach is wrong because it does not consider the fact that the &lt;CODE&gt;'&lt;/CODE&gt; character frequently occur inside of the field data with an escape character and this will strip the quote but leave the escape and be very confusing.  How are you creating your fields now?  Are you using &lt;CODE&gt;KV_MODE=auto&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 11:59:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311308#M161008</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-25T11:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: remove the special character ' from beginning and end of the field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311309#M161009</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;To handle it at search time, you can add the following to props.conf (on searchheads):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Sourcetype]
EXTRACT-app = app=\'(?&amp;lt;app&amp;gt;\w+)\'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and so on for other fields.&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 12:22:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311309#M161009</guid>
      <dc:creator>aakwah</dc:creator>
      <dc:date>2017-05-25T12:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: remove the special character ' from beginning and end of the field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311310#M161010</link>
      <description>&lt;P&gt;yes I am using auto mode.&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 12:23:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311310#M161010</guid>
      <dc:creator>mustafag</dc:creator>
      <dc:date>2017-05-25T12:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: remove the special character ' from beginning and end of the field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311311#M161011</link>
      <description>&lt;P&gt;SEDCMD is used at index time.&lt;/P&gt;

&lt;P&gt;as per docs (&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/admin/Propsconf):"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.1/admin/Propsconf):&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-&amp;lt;class&amp;gt; = &amp;lt;sed script&amp;gt;
* Only used at index time.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 May 2017 12:43:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311311#M161011</guid>
      <dc:creator>aakwah</dc:creator>
      <dc:date>2017-05-25T12:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: remove the special character ' from beginning and end of the field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311312#M161012</link>
      <description>&lt;P&gt;No this will not help because &lt;CODE&gt;EXTRACT&lt;/CODE&gt; happens before &lt;CODE&gt;KV_MODE&lt;/CODE&gt;; that's why I asked how the fields were being created.&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 13:27:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311312#M161012</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-25T13:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: remove the special character ' from beginning and end of the field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311313#M161013</link>
      <description>&lt;P&gt;@woodcock as per my test (Splunk version 6.5.3) &lt;CODE&gt;EXTRACT&lt;/CODE&gt; is working fine with &lt;CODE&gt;KV_MODE=auto&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 14:24:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311313#M161013</guid>
      <dc:creator>aakwah</dc:creator>
      <dc:date>2017-05-25T14:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: remove the special character ' from beginning and end of the field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311314#M161014</link>
      <description>&lt;P&gt;The Search-Time Order of Operations is this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sourcetype RENAME
EXTRACT-xxx
REPORT-xxx
KV_MODE
FIELDALIAS-xxx
EVAL-xxx
LOOKUP-xxx
MILLISECONDS
FILTER
EVENTTYPING
TAGGING
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So use &lt;CODE&gt;EVAL&lt;/CODE&gt; instead of &lt;CODE&gt;EXTRACT&lt;/CODE&gt; and try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[YourSourcetypeHere]
EVAL-app=replace(app, "^'|'$", "")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And so on for all of the field names.&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 19:32:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311314#M161014</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-25T19:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: remove the special character ' from beginning and end of the field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311315#M161015</link>
      <description>&lt;P&gt;This is very strange but hey; there you go!&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 19:34:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311315#M161015</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-25T19:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: remove the special character ' from beginning and end of the field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311316#M161016</link>
      <description>&lt;P&gt;I believe that allowing EXTRACT to work after KV_MODE is intended to make some tweaks on the automatically extracted fields.&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 19:49:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/remove-the-special-character-from-beginning-and-end-of-the-field/m-p/311316#M161016</guid>
      <dc:creator>aakwah</dc:creator>
      <dc:date>2017-05-25T19:49:09Z</dc:date>
    </item>
  </channel>
</rss>

