<?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 How to create a source type of file positional in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-source-type-of-file-positional/m-p/176757#M35461</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;I have a file that contains blocks of data that are positionals, they have the size of fields Folloowing sample:&lt;/P&gt;

&lt;P&gt;For the first field, the position could be the first byte with size of 3 positions and each fields following have a rule specific.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;0083410001049703K        ARQB4_B8E4_07                    000000TESTENT 2513145609235200000000000000      CP000000000000WW&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;How to create a source type for this ?&lt;/P&gt;</description>
    <pubDate>Thu, 12 Dec 2013 16:17:31 GMT</pubDate>
    <dc:creator>rafamss</dc:creator>
    <dc:date>2013-12-12T16:17:31Z</dc:date>
    <item>
      <title>How to create a source type of file positional</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-source-type-of-file-positional/m-p/176757#M35461</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;I have a file that contains blocks of data that are positionals, they have the size of fields Folloowing sample:&lt;/P&gt;

&lt;P&gt;For the first field, the position could be the first byte with size of 3 positions and each fields following have a rule specific.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;0083410001049703K        ARQB4_B8E4_07                    000000TESTENT 2513145609235200000000000000      CP000000000000WW&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;How to create a source type for this ?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2013 16:17:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-source-type-of-file-positional/m-p/176757#M35461</guid>
      <dc:creator>rafamss</dc:creator>
      <dc:date>2013-12-12T16:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a source type of file positional</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-source-type-of-file-positional/m-p/176758#M35462</link>
      <description>&lt;P&gt;When you tell Splunk to index the file, in &lt;CODE&gt;inputs.conf&lt;/CODE&gt; (or in the GUI), give it a sourcetype name. Just choose a name that doesn't already exist and you will be fine ...&lt;/P&gt;

&lt;P&gt;inputs.conf  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///path/to/mylogfile.log]
sourcetype = myNewSourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now you have a new sourcetype. To define the fields, you can use &lt;CODE&gt;props.conf&lt;/CODE&gt; (and &lt;CODE&gt;transforms.conf&lt;/CODE&gt;) quite easily.&lt;BR /&gt;
For example, if the first field is 6 digits and the second field is 4 digits, you could do this &lt;/P&gt;

&lt;P&gt;props.conf  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myNewSourcetype]
EXTRACT-mns1 = (?&amp;lt;Field1&amp;gt;\d{6})(?&amp;lt;Field2&amp;gt;\d{4})
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You do need to know regular expressions, and you should probably also read&lt;/P&gt;

&lt;P&gt;The docs &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles"&gt;Create and maintain field extractions...&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This answer &lt;A href="http://answers.splunk.com/answers/12730/define-custom-fixed-fields"&gt;define custom fixed fields&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2013 16:51:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-source-type-of-file-positional/m-p/176758#M35462</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-12-12T16:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a source type of file positional</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-source-type-of-file-positional/m-p/176759#M35463</link>
      <description>&lt;P&gt;Hi lguinn,&lt;/P&gt;

&lt;P&gt;I have one problem, in my file has blank spaces and special characters. When I put the regex for extract the information that i need, it's not understanding this.&lt;/P&gt;

&lt;P&gt;Do you know the which I need to do ? I tried use \D \d or just the dot for get the information, without success.&lt;/P&gt;

&lt;P&gt;PS. I looked in the links above.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2013 18:17:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-source-type-of-file-positional/m-p/176759#M35463</guid>
      <dc:creator>rafamss</dc:creator>
      <dc:date>2013-12-12T18:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a source type of file positional</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-source-type-of-file-positional/m-p/176760#M35464</link>
      <description>&lt;P&gt;Hi Iguinn,&lt;/P&gt;

&lt;P&gt;The problem was in the file. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2013 19:38:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-source-type-of-file-positional/m-p/176760#M35464</guid>
      <dc:creator>rafamss</dc:creator>
      <dc:date>2013-12-12T19:38:19Z</dc:date>
    </item>
  </channel>
</rss>

