<?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: eliminate unnecessary values when indexing in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407265#M72222</link>
    <description>&lt;P&gt;Replace it with an empty string.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jun 2018 12:04:25 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2018-06-29T12:04:25Z</dc:date>
    <item>
      <title>eliminate unnecessary values when indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407258#M72215</link>
      <description>&lt;P&gt;good morning&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I want to ignore certain elements of a log when indexing them, for example:&lt;/P&gt;

&lt;P&gt;field0 | x | x | x | x | x | field6 | field7 | field8 | x | x | x | field12 | field13 | field14 | field15 | field16 | field17 | x | field19 | field20 | x | x | x | x | x | x | field27 | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | field48&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have many values in this line of events and I just want the FIELDXX values to be indexed, and the values between | x | do not. I know that a whole line of events can be ignored using the transform.conf, but in this case I only want certain values. Is this possible?&lt;/P&gt;

&lt;P&gt;regards&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 16:50:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407258#M72215</guid>
      <dc:creator>efaundez</dc:creator>
      <dc:date>2018-06-28T16:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: eliminate unnecessary values when indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407259#M72216</link>
      <description>&lt;P&gt;Depending on what "x" really is, you may be able to use SEDCMD to edit them out.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 16:54:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407259#M72216</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-06-28T16:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: eliminate unnecessary values when indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407260#M72217</link>
      <description>&lt;P&gt;thanks for the answer, is there any documentation or example to validate and test?&lt;/P&gt;

&lt;P&gt;regards&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 16:59:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407260#M72217</guid>
      <dc:creator>efaundez</dc:creator>
      <dc:date>2018-06-28T16:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: eliminate unnecessary values when indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407261#M72218</link>
      <description>&lt;P&gt;most of the field1, field2, field3 ... are numeric and some dates&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 17:00:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407261#M72218</guid>
      <dc:creator>efaundez</dc:creator>
      <dc:date>2018-06-28T17:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: eliminate unnecessary values when indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407262#M72219</link>
      <description>&lt;P&gt;Here's the documentation for SEDCMD in props.conf&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.1.1/Data/Anonymizedata#Define_the_sed_script_in_props.conf"&gt;https://docs.splunk.com/Documentation/Splunk/7.1.1/Data/Anonymizedata#Define_the_sed_script_in_props.conf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 17:42:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407262#M72219</guid>
      <dc:creator>lacastillo</dc:creator>
      <dc:date>2018-06-28T17:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: eliminate unnecessary values when indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407263#M72220</link>
      <description>&lt;P&gt;thanks for the reply&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I will do the relevant tests.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 17:48:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407263#M72220</guid>
      <dc:creator>efaundez</dc:creator>
      <dc:date>2018-06-28T17:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: eliminate unnecessary values when indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407264#M72221</link>
      <description>&lt;P&gt;it is not required to mask the data, it is necessary to omit and not replace it with another value or text.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 18:02:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407264#M72221</guid>
      <dc:creator>efaundez</dc:creator>
      <dc:date>2018-06-28T18:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: eliminate unnecessary values when indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407265#M72222</link>
      <description>&lt;P&gt;Replace it with an empty string.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 12:04:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407265#M72222</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-06-29T12:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: eliminate unnecessary values when indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407266#M72223</link>
      <description>&lt;P&gt;If you must do this in Splunk (on your Indexers), you can do it with &lt;CODE&gt;SEDCMD&lt;/CODE&gt;.  Here is a proof of concept:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="field0 | x | x | x | x | x | field6 | field7 | field8 | x | x | x | field12 | field13 | field14 | field15 | field16 | field17 | x | field19 | field20 | x | x | x | x | x | x | field27 | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | field48"
| eval raw2=_raw
| rex field=raw2 mode=sed "s/\s*x\s*(?=|)//g"
| rex field=_raw mode=sed "s/^([^|]*(?=|))\|(?:[^|]*(?=|)\|){5}((?:[^|]*(?=|)\|){3})(?:[^|]*(?=|)\|){3}((?:[^|]*(?=|)\|){6})(?:[^|]*(?=|)\|){1}((?:[^|]*(?=|)\|){2})(?:[^|]*(?=|)\|){6}((?:[^|]*(?=|)\|){1})(?:[^|]*(?=|)\|){20}(.*)$/\1||||||\2|||\3|\4||||||\5||||||||||||||||||||\6/"
| eval TEST=if((raw2==_raw), "GOOD!", "ERROR!")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So your props.conf line would look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-strip_some_PSV_values = s/^([^|]*(?=|))\|(?:[^|]*(?=|)\|){5}((?:[^|]*(?=|)\|){3})(?:[^|]*(?=|)\|){3}((?:[^|]*(?=|)\|){6})(?:[^|]*(?=|)\|){1}((?:[^|]*(?=|)\|){2})(?:[^|]*(?=|)\|){6}((?:[^|]*(?=|)\|){1})(?:[^|]*(?=|)\|){20}(.*)$/\1||||||\2|||\3|\4||||||\5||||||||||||||||||||\6/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Jun 2018 15:23:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407266#M72223</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-06-30T15:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: eliminate unnecessary values when indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407267#M72224</link>
      <description>&lt;P&gt;good morning&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; Thanks for your answer, I'll do the relevant tests&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 13:15:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/eliminate-unnecessary-values-when-indexing/m-p/407267#M72224</guid>
      <dc:creator>efaundez</dc:creator>
      <dc:date>2018-07-03T13:15:37Z</dc:date>
    </item>
  </channel>
</rss>

