<?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 After adding a custom field in Splunk, why am I getting error &amp;quot;In handler 'oneshotinput': Argument &amp;quot;dateofdata&amp;quot; is not supported by this handler.&amp;quot;? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/After-adding-a-custom-field-in-Splunk-why-am-I-getting-error/m-p/259083#M3219</link>
    <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I need to add a field which represents the date of the indexed data. I need to fetch the results in a search based on data. So, I tried to add a custom field in Splunk. &lt;/P&gt;

&lt;P&gt;I added a new field in fields.conf file as follows. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[dateofdata]
INDEXED = True
INDEXED_VALUE = False
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As I need to index the data using Splunk Java API, I used it as follows.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Service service = new Service("localhost", 8089);
        connect(loginArgs);

        Args eventArgs = new Args();
        eventArgs.put("sourcetype", "whole_file");
        eventArgs.put("host", "local");
        eventArgs.put("dateofdata","20160125");

        IndexCollection myIndexes = service.getIndexes();
        Index index = myIndexes.get("my_index3");

        index.upload(
                "/Users/srini/imp_work/xml_dump/2016-01-16/xml_file_1.xml",
                eventArgs);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I got the following error when I executed it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Exception in thread "main" com.splunk.HttpException: HTTP 400 -- 
 In handler 'oneshotinput': Argument "dateofdata" is not supported by this handler.
    at com.splunk.HttpException.create(HttpException.java:84)
    at com.splunk.HttpService.send(HttpService.java:452)
    at com.splunk.Service.send(Service.java:1293)
    at com.splunk.HttpService.post(HttpService.java:308)
    at com.splunk.EntityCollection.create(EntityCollection.java:95)
    at com.splunk.Index.upload(Index.java:1131)
    at com.srini.splunk.SplunkExample.main(SplunkExample.java:31)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 01 Feb 2016 05:50:03 GMT</pubDate>
    <dc:creator>sdaruna</dc:creator>
    <dc:date>2016-02-01T05:50:03Z</dc:date>
    <item>
      <title>After adding a custom field in Splunk, why am I getting error "In handler 'oneshotinput': Argument "dateofdata" is not supported by this handler."?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/After-adding-a-custom-field-in-Splunk-why-am-I-getting-error/m-p/259083#M3219</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I need to add a field which represents the date of the indexed data. I need to fetch the results in a search based on data. So, I tried to add a custom field in Splunk. &lt;/P&gt;

&lt;P&gt;I added a new field in fields.conf file as follows. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[dateofdata]
INDEXED = True
INDEXED_VALUE = False
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As I need to index the data using Splunk Java API, I used it as follows.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Service service = new Service("localhost", 8089);
        connect(loginArgs);

        Args eventArgs = new Args();
        eventArgs.put("sourcetype", "whole_file");
        eventArgs.put("host", "local");
        eventArgs.put("dateofdata","20160125");

        IndexCollection myIndexes = service.getIndexes();
        Index index = myIndexes.get("my_index3");

        index.upload(
                "/Users/srini/imp_work/xml_dump/2016-01-16/xml_file_1.xml",
                eventArgs);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I got the following error when I executed it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Exception in thread "main" com.splunk.HttpException: HTTP 400 -- 
 In handler 'oneshotinput': Argument "dateofdata" is not supported by this handler.
    at com.splunk.HttpException.create(HttpException.java:84)
    at com.splunk.HttpService.send(HttpService.java:452)
    at com.splunk.Service.send(Service.java:1293)
    at com.splunk.HttpService.post(HttpService.java:308)
    at com.splunk.EntityCollection.create(EntityCollection.java:95)
    at com.splunk.Index.upload(Index.java:1131)
    at com.srini.splunk.SplunkExample.main(SplunkExample.java:31)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Feb 2016 05:50:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/After-adding-a-custom-field-in-Splunk-why-am-I-getting-error/m-p/259083#M3219</guid>
      <dc:creator>sdaruna</dc:creator>
      <dc:date>2016-02-01T05:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: After adding a custom field in Splunk, why am I getting error "In handler 'oneshotinput': Argument "dateofdata" is not supported by this handler."?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/After-adding-a-custom-field-in-Splunk-why-am-I-getting-error/m-p/259084#M3220</link>
      <description>&lt;P&gt;HI, _indextime might help you.&lt;/P&gt;

&lt;P&gt;The _indextimefield contains the time that an event was indexed, expressed in&lt;BR /&gt;
Unix time. You might use this field to focus on or filter out events that were&lt;BR /&gt;
indexed within a specific range of time.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2016 10:10:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/After-adding-a-custom-field-in-Splunk-why-am-I-getting-error/m-p/259084#M3220</guid>
      <dc:creator>stephane_cyrill</dc:creator>
      <dc:date>2016-02-01T10:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: After adding a custom field in Splunk, why am I getting error "In handler 'oneshotinput': Argument "dateofdata" is not supported by this handler."?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/After-adding-a-custom-field-in-Splunk-why-am-I-getting-error/m-p/259085#M3221</link>
      <description>&lt;P&gt;Hi Stephane,&lt;/P&gt;

&lt;P&gt;I do not need the exact indexed time. I could index any date data at any time. But, i need to fetch data by date when receiving. &lt;/P&gt;

&lt;P&gt;It was same error, if i tried to set _indextime field through program.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2016 15:26:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/After-adding-a-custom-field-in-Splunk-why-am-I-getting-error/m-p/259085#M3221</guid>
      <dc:creator>sdaruna</dc:creator>
      <dc:date>2016-02-01T15:26:50Z</dc:date>
    </item>
  </channel>
</rss>

