<?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: index only part of a log? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/index-only-part-of-a-log/m-p/87031#M18067</link>
    <description>&lt;P&gt;Here is the easiest and most efficient way to do it. On the Splunk server, put the following in&lt;BR /&gt;&lt;BR /&gt;
$SPLUNK_HOME/etc/system/local/props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::nameoffiles]
TRUNCATE = 100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;TRUNCATE says "only index the first 100 characters of each event." The 100 is arbitrary, but if you can figure out a reasonable value for your situation, it will work well. And if you sometimes get a a little bit of the "garbage" in there, you can just ignore it.&lt;/P&gt;

&lt;P&gt;For the "nameoffiles", you must specify the input files that should be affected. You can use wildcards here, but be careful. And you do need to specify the full path name, etc. Take a look in the manual for more info about &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.1/admin/Propsconf"&gt;props.conf&lt;/A&gt;.&lt;BR /&gt;
You could specify the same thing, but using the sourcetype of the data instead - if the data all has the same sourcetype:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetypename]
TRUNCATE = 100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;There are other ways to do this, but they require more processing, etc.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Mar 2012 02:25:26 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2012-03-08T02:25:26Z</dc:date>
    <item>
      <title>index only part of a log?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/index-only-part-of-a-log/m-p/87030#M18066</link>
      <description>&lt;P&gt;Is there a way to index only part of a log?  These logs are custom log files from a windows server.  There are thousands of files, each file belonging to an AD user, and the files are updated when a user logs onto/off of a domain machine.  I don't want the entire log to be index because there is a lot of junk in there that I don't need or want to index.  For example this is the structure:&lt;/P&gt;

&lt;P&gt;Date | Time | user | macaddress | IP | Function | computer name | AD Display Name | share directory | then a bunch of other garbage | etc.&lt;/P&gt;

&lt;P&gt;Basically I need everything but share directory, AD Display name, macaddress, and the other garbage.  &lt;/P&gt;

&lt;P&gt;The windows server that the files are sitting on is separate from the splunk server.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2012 23:02:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/index-only-part-of-a-log/m-p/87030#M18066</guid>
      <dc:creator>gregwilliams</dc:creator>
      <dc:date>2012-03-07T23:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: index only part of a log?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/index-only-part-of-a-log/m-p/87031#M18067</link>
      <description>&lt;P&gt;Here is the easiest and most efficient way to do it. On the Splunk server, put the following in&lt;BR /&gt;&lt;BR /&gt;
$SPLUNK_HOME/etc/system/local/props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::nameoffiles]
TRUNCATE = 100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;TRUNCATE says "only index the first 100 characters of each event." The 100 is arbitrary, but if you can figure out a reasonable value for your situation, it will work well. And if you sometimes get a a little bit of the "garbage" in there, you can just ignore it.&lt;/P&gt;

&lt;P&gt;For the "nameoffiles", you must specify the input files that should be affected. You can use wildcards here, but be careful. And you do need to specify the full path name, etc. Take a look in the manual for more info about &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.1/admin/Propsconf"&gt;props.conf&lt;/A&gt;.&lt;BR /&gt;
You could specify the same thing, but using the sourcetype of the data instead - if the data all has the same sourcetype:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetypename]
TRUNCATE = 100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;There are other ways to do this, but they require more processing, etc.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2012 02:25:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/index-only-part-of-a-log/m-p/87031#M18067</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-03-08T02:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: index only part of a log?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/index-only-part-of-a-log/m-p/87032#M18068</link>
      <description>&lt;P&gt;Thanks!  The fields are fixed length so this works perfectly for what I'm trying to do.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2012 16:43:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/index-only-part-of-a-log/m-p/87032#M18068</guid>
      <dc:creator>gregwilliams</dc:creator>
      <dc:date>2012-03-08T16:43:02Z</dc:date>
    </item>
  </channel>
</rss>

