<?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 specify field names while loading the data using splunk java api in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-specify-field-names-while-loading-the-data-using-splunk/m-p/278877#M53369</link>
    <description>&lt;P&gt;sure martin. thank you...&lt;/P&gt;

&lt;P&gt;apologies for asking u again.. do you have any comments on the flow i explained.?&lt;/P&gt;</description>
    <pubDate>Mon, 14 Dec 2015 00:26:24 GMT</pubDate>
    <dc:creator>sdaruna</dc:creator>
    <dc:date>2015-12-14T00:26:24Z</dc:date>
    <item>
      <title>How to specify field names while loading the data using splunk java api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-specify-field-names-while-loading-the-data-using-splunk/m-p/278873#M53365</link>
      <description>&lt;P&gt;I would like to index the data using java api. How could i specify the field names while indexing the data.?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2015 13:23:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-specify-field-names-while-loading-the-data-using-splunk/m-p/278873#M53365</guid>
      <dc:creator>sdaruna</dc:creator>
      <dc:date>2015-12-13T13:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify field names while loading the data using splunk java api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-specify-field-names-while-loading-the-data-using-splunk/m-p/278874#M53366</link>
      <description>&lt;P&gt;Usually splunk fields are search-time, so there's no need to specify any while indexing. Is there any reason why you'd like to do that?&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1/Knowledge/Aboutfields"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1/Knowledge/Aboutfields&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2015 23:10:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-specify-field-names-while-loading-the-data-using-splunk/m-p/278874#M53366</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-12-13T23:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify field names while loading the data using splunk java api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-specify-field-names-while-loading-the-data-using-splunk/m-p/278875#M53367</link>
      <description>&lt;P&gt;Hi Martin,&lt;/P&gt;

&lt;P&gt;Thanks very much for your response. I was literally crumbling to achieve my requirement. &lt;BR /&gt;
Let me tell you my requirement.&lt;/P&gt;

&lt;P&gt;I will get a huge xml file of configurations from client. I need to take one node each and index into separate indexes respectively and finally i need to get a table joining the indexes. Lets stay, i will get xml with classes, students and courses. I need to fetch classes from xml and need to index to classe and similar to others. &lt;BR /&gt;
After this, i need to create a table out of them joining those three. &lt;/P&gt;

&lt;P&gt;I chose java indexing for this. So, i will get xml and get the xpath data, and then form event string and then index them to splunk. I was wondering how to specify the fieldnames while indexing.. &lt;/P&gt;

&lt;P&gt;1) Did i chose right way, or is there any other way.?&lt;BR /&gt;
2) if so, can i specify the fieldnames while indexing the events into splunk.?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2015 23:57:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-specify-field-names-while-loading-the-data-using-splunk/m-p/278875#M53367</guid>
      <dc:creator>sdaruna</dc:creator>
      <dc:date>2015-12-13T23:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify field names while loading the data using splunk java api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-specify-field-names-while-loading-the-data-using-splunk/m-p/278876#M53368</link>
      <description>&lt;P&gt;Is this essentially the same question as &lt;A href="https://answers.splunk.com/answers/334380/how-to-load-java-objects-into-plunk.html"&gt;https://answers.splunk.com/answers/334380/how-to-load-java-objects-into-plunk.html&lt;/A&gt;? If so, then please stick to that question.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2015 00:03:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-specify-field-names-while-loading-the-data-using-splunk/m-p/278876#M53368</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-12-14T00:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify field names while loading the data using splunk java api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-specify-field-names-while-loading-the-data-using-splunk/m-p/278877#M53369</link>
      <description>&lt;P&gt;sure martin. thank you...&lt;/P&gt;

&lt;P&gt;apologies for asking u again.. do you have any comments on the flow i explained.?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2015 00:26:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-specify-field-names-while-loading-the-data-using-splunk/m-p/278877#M53369</guid>
      <dc:creator>sdaruna</dc:creator>
      <dc:date>2015-12-14T00:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify field names while loading the data using splunk java api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-specify-field-names-while-loading-the-data-using-splunk/m-p/278878#M53370</link>
      <description>&lt;P&gt;To get "indexed field extractions" see "indexed_extractions" in props.conf documentation here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1511/admin/Propsconf" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1511/admin/Propsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You need to create input app that runs your Java as a scripted input.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#I do this so I can see errors on STDOUT caused by the script.. by opening index=_internal in splunk.
[script:///opt/splunk/etc/apps/java_input_app/bin/javabinary]
index = _internal 
sourcetype = java_etl
source = javabinary
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then the inputs necessary to read the files your javabinary is creating:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[batch:///opt/splunk/etc/apps/java_input_app/data/1.csv]
index = index1
sourcetype = 1csv
crcSalt = &amp;lt;SOURCE&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Finally you need props.conf entry for each of your sourcetypes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[1csv]
INDEXED_EXTRACTIONS = CSV
FIELD_DELIMITER = ,
FIELD_QUOTE = "
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Put props.conf and inputs.conf in  .../java_input_app/local  or /default... see configuration file precedence for more details as to which will supersede the other.  &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1511/Admin/Wheretofindtheconfigurationfiles" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1511/Admin/Wheretofindtheconfigurationfiles&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:07:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-specify-field-names-while-loading-the-data-using-splunk/m-p/278878#M53370</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2020-09-29T08:07:15Z</dc:date>
    </item>
  </channel>
</rss>

