<?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 Why am I unable to pass field values as arguments for my custom search command? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-unable-to-pass-field-values-as-arguments-for-my-custom/m-p/252818#M3147</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I recently created a custom search command allowing me to output results of a search directly to hdfs via webhdfs.&lt;/P&gt;

&lt;P&gt;After some time trying to figure out the Python SDK, I've finally managed to achieve my purpose.&lt;/P&gt;

&lt;P&gt;My command work as follow:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[splunk search] | outputhdfs [path/to/hdfs/] [fileName] [fields_to_export] [separator]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I'd like to do is to pass a field value, such as a date or something, as my fileName, but it doesn't seem to work&lt;/P&gt;

&lt;P&gt;like when i do :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[splunk_search] |eval datePart = strftime(s_cnxTime,"%Y%m%d") | outputhdfs path="/tmp/outputhdfs/" file=datePart fields="KeyID, ConnexionTime, Suspect, Time_Transfert" separator="#"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it creates a file named datePart at the specified path.&lt;/P&gt;

&lt;P&gt;If you have any ideas &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Wandrille&lt;/P&gt;</description>
    <pubDate>Thu, 01 Dec 2016 16:09:25 GMT</pubDate>
    <dc:creator>wandrilleD</dc:creator>
    <dc:date>2016-12-01T16:09:25Z</dc:date>
    <item>
      <title>Why am I unable to pass field values as arguments for my custom search command?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-unable-to-pass-field-values-as-arguments-for-my-custom/m-p/252818#M3147</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I recently created a custom search command allowing me to output results of a search directly to hdfs via webhdfs.&lt;/P&gt;

&lt;P&gt;After some time trying to figure out the Python SDK, I've finally managed to achieve my purpose.&lt;/P&gt;

&lt;P&gt;My command work as follow:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[splunk search] | outputhdfs [path/to/hdfs/] [fileName] [fields_to_export] [separator]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I'd like to do is to pass a field value, such as a date or something, as my fileName, but it doesn't seem to work&lt;/P&gt;

&lt;P&gt;like when i do :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[splunk_search] |eval datePart = strftime(s_cnxTime,"%Y%m%d") | outputhdfs path="/tmp/outputhdfs/" file=datePart fields="KeyID, ConnexionTime, Suspect, Time_Transfert" separator="#"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it creates a file named datePart at the specified path.&lt;/P&gt;

&lt;P&gt;If you have any ideas &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Wandrille&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 16:09:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-unable-to-pass-field-values-as-arguments-for-my-custom/m-p/252818#M3147</guid>
      <dc:creator>wandrilleD</dc:creator>
      <dc:date>2016-12-01T16:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to pass field values as arguments for my custom search command?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-unable-to-pass-field-values-as-arguments-for-my-custom/m-p/252819#M3148</link>
      <description>&lt;P&gt;Although, I am not sure why your command is not working, I was wandering why not just use the Splunk Supported App - hadoop connect - to Export search results into HDFS?&lt;BR /&gt;
Here is the link to the function in hadoop connect that seems to do the same as outputhdfs : &lt;A href="http://docs.splunk.com/Documentation/HadoopConnect/1.2.3/DeployHadoopConnect/ExporttoHDFS"&gt;http://docs.splunk.com/Documentation/HadoopConnect/1.2.3/DeployHadoopConnect/ExporttoHDFS&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 17:37:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-unable-to-pass-field-values-as-arguments-for-my-custom/m-p/252819#M3148</guid>
      <dc:creator>rdagan_splunk</dc:creator>
      <dc:date>2016-12-01T17:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to pass field values as arguments for my custom search command?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-unable-to-pass-field-values-as-arguments-for-my-custom/m-p/252820#M3149</link>
      <description>&lt;P&gt;The command works, we didn't use the export from hadoop connect because we needed a custom command anyway, the question here only concerns the problem to pass a date as an argument of the custom command.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 09:47:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-unable-to-pass-field-values-as-arguments-for-my-custom/m-p/252820#M3149</guid>
      <dc:creator>wandrilleD</dc:creator>
      <dc:date>2016-12-02T09:47:06Z</dc:date>
    </item>
  </channel>
</rss>

