Advertisement
Guest User

Untitled

a guest
Aug 10th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.35 KB | None | 0 0
  1. <?xml version="1.0" ?>
  2. <template encoding-version="1.0">
  3. <description>This template shows how to use ExecuteScript with Groovy and Sshoogr to execute commands (from an incoming flow file) on a remote system (via SSH).
  4.  
  5. To use, replace the values in ExecuteScript for your remote system (sshHostname, sshUsername, sshPassword, sshPort), and replace the GenerateFlowFile processor (and the associated ReplaceText processor) with your flow that produces files with lines of commands to run remotely.</description>
  6. <groupId>71f9bd06-0156-1000-783e-41e29ccff3d8</groupId>
  7. <name>ExecuteScriptRemoteCommands</name>
  8. <snippet>
  9. <connections>
  10. <id>7492dda1-0156-1000-0000-000000000000</id>
  11. <parentGroupId>71f9bd06-0156-1000-0000-000000000000</parentGroupId>
  12. <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
  13. <backPressureObjectThreshold>10000</backPressureObjectThreshold>
  14. <bends>
  15. <x>357.0</x>
  16. <y>631.0</y>
  17. </bends>
  18. <destination>
  19. <groupId>71f9bd06-0156-1000-0000-000000000000</groupId>
  20. <id>7492b587-0156-1000-0000-000000000000</id>
  21. <type>PROCESSOR</type>
  22. </destination>
  23. <flowFileExpiration>0 sec</flowFileExpiration>
  24. <labelIndex>0</labelIndex>
  25. <name></name>
  26. <selectedRelationships>success</selectedRelationships>
  27. <source>
  28. <groupId>71f9bd06-0156-1000-0000-000000000000</groupId>
  29. <id>7490b268-0156-1000-0000-000000000000</id>
  30. <type>PROCESSOR</type>
  31. </source>
  32. <zIndex>0</zIndex>
  33. </connections>
  34. <connections>
  35. <id>74aa48c3-0156-1000-0000-000000000000</id>
  36. <parentGroupId>71f9bd06-0156-1000-0000-000000000000</parentGroupId>
  37. <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
  38. <backPressureObjectThreshold>10000</backPressureObjectThreshold>
  39. <bends>
  40. <x>27.0</x>
  41. <y>638.0</y>
  42. </bends>
  43. <destination>
  44. <groupId>71f9bd06-0156-1000-0000-000000000000</groupId>
  45. <id>7492b587-0156-1000-0000-000000000000</id>
  46. <type>PROCESSOR</type>
  47. </destination>
  48. <flowFileExpiration>0 sec</flowFileExpiration>
  49. <labelIndex>1</labelIndex>
  50. <name></name>
  51. <selectedRelationships>failure</selectedRelationships>
  52. <source>
  53. <groupId>71f9bd06-0156-1000-0000-000000000000</groupId>
  54. <id>7490b268-0156-1000-0000-000000000000</id>
  55. <type>PROCESSOR</type>
  56. </source>
  57. <zIndex>0</zIndex>
  58. </connections>
  59. <connections>
  60. <id>74c0c5e7-0156-1000-0000-000000000000</id>
  61. <parentGroupId>71f9bd06-0156-1000-0000-000000000000</parentGroupId>
  62. <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
  63. <backPressureObjectThreshold>10000</backPressureObjectThreshold>
  64. <destination>
  65. <groupId>71f9bd06-0156-1000-0000-000000000000</groupId>
  66. <id>74c07bf5-0156-1000-0000-000000000000</id>
  67. <type>PROCESSOR</type>
  68. </destination>
  69. <flowFileExpiration>0 sec</flowFileExpiration>
  70. <labelIndex>1</labelIndex>
  71. <name></name>
  72. <selectedRelationships>success</selectedRelationships>
  73. <source>
  74. <groupId>71f9bd06-0156-1000-0000-000000000000</groupId>
  75. <id>74c06dde-0156-1000-0000-000000000000</id>
  76. <type>PROCESSOR</type>
  77. </source>
  78. <zIndex>0</zIndex>
  79. </connections>
  80. <connections>
  81. <id>74c0f7d0-0156-1000-0000-000000000000</id>
  82. <parentGroupId>71f9bd06-0156-1000-0000-000000000000</parentGroupId>
  83. <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
  84. <backPressureObjectThreshold>10000</backPressureObjectThreshold>
  85. <destination>
  86. <groupId>71f9bd06-0156-1000-0000-000000000000</groupId>
  87. <id>7490b268-0156-1000-0000-000000000000</id>
  88. <type>PROCESSOR</type>
  89. </destination>
  90. <flowFileExpiration>0 sec</flowFileExpiration>
  91. <labelIndex>1</labelIndex>
  92. <name></name>
  93. <selectedRelationships>success</selectedRelationships>
  94. <source>
  95. <groupId>71f9bd06-0156-1000-0000-000000000000</groupId>
  96. <id>74c07bf5-0156-1000-0000-000000000000</id>
  97. <type>PROCESSOR</type>
  98. </source>
  99. <zIndex>0</zIndex>
  100. </connections>
  101. <processors>
  102. <id>7490b268-0156-1000-0000-000000000000</id>
  103. <parentGroupId>71f9bd06-0156-1000-0000-000000000000</parentGroupId>
  104. <position>
  105. <x>2.0</x>
  106. <y>437.0</y>
  107. </position>
  108. <config>
  109. <bulletinLevel>WARN</bulletinLevel>
  110. <comments></comments>
  111. <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
  112. <descriptors>
  113. <entry>
  114. <key>Script Engine</key>
  115. <value>
  116. <allowableValues>
  117. <displayName>ECMAScript</displayName>
  118. <value>ECMAScript</value>
  119. </allowableValues>
  120. <allowableValues>
  121. <displayName>Groovy</displayName>
  122. <value>Groovy</value>
  123. </allowableValues>
  124. <allowableValues>
  125. <displayName>lua</displayName>
  126. <value>lua</value>
  127. </allowableValues>
  128. <allowableValues>
  129. <displayName>python</displayName>
  130. <value>python</value>
  131. </allowableValues>
  132. <allowableValues>
  133. <displayName>ruby</displayName>
  134. <value>ruby</value>
  135. </allowableValues>
  136. <defaultValue>ECMAScript</defaultValue>
  137. <description>The engine to execute scripts</description>
  138. <displayName>Script Engine</displayName>
  139. <dynamic>false</dynamic>
  140. <name>Script Engine</name>
  141. <required>true</required>
  142. <sensitive>false</sensitive>
  143. <supportsEl>false</supportsEl>
  144. </value>
  145. </entry>
  146. <entry>
  147. <key>Script File</key>
  148. <value>
  149. <description>Path to script file to execute. Only one of Script File or Script Body may be used</description>
  150. <displayName>Script File</displayName>
  151. <dynamic>false</dynamic>
  152. <name>Script File</name>
  153. <required>false</required>
  154. <sensitive>false</sensitive>
  155. <supportsEl>true</supportsEl>
  156. </value>
  157. </entry>
  158. <entry>
  159. <key>Script Body</key>
  160. <value>
  161. <description>Body of script to execute. Only one of Script File or Script Body may be used</description>
  162. <displayName>Script Body</displayName>
  163. <dynamic>false</dynamic>
  164. <name>Script Body</name>
  165. <required>false</required>
  166. <sensitive>false</sensitive>
  167. <supportsEl>false</supportsEl>
  168. </value>
  169. </entry>
  170. <entry>
  171. <key>Module Directory</key>
  172. <value>
  173. <description>Comma-separated list of paths to files and/or directories which contain modules required by the script.</description>
  174. <displayName>Module Directory</displayName>
  175. <dynamic>false</dynamic>
  176. <name>Module Directory</name>
  177. <required>false</required>
  178. <sensitive>false</sensitive>
  179. <supportsEl>false</supportsEl>
  180. </value>
  181. </entry>
  182. <entry>
  183. <key>sshHostname</key>
  184. <value>
  185. <description></description>
  186. <displayName>sshHostname</displayName>
  187. <dynamic>true</dynamic>
  188. <name>sshHostname</name>
  189. <required>false</required>
  190. <sensitive>false</sensitive>
  191. <supportsEl>true</supportsEl>
  192. </value>
  193. </entry>
  194. <entry>
  195. <key>sshPassword</key>
  196. <value>
  197. <description></description>
  198. <displayName>sshPassword</displayName>
  199. <dynamic>true</dynamic>
  200. <name>sshPassword</name>
  201. <required>false</required>
  202. <sensitive>false</sensitive>
  203. <supportsEl>true</supportsEl>
  204. </value>
  205. </entry>
  206. <entry>
  207. <key>sshPort</key>
  208. <value>
  209. <description></description>
  210. <displayName>sshPort</displayName>
  211. <dynamic>true</dynamic>
  212. <name>sshPort</name>
  213. <required>false</required>
  214. <sensitive>false</sensitive>
  215. <supportsEl>true</supportsEl>
  216. </value>
  217. </entry>
  218. <entry>
  219. <key>sshUsername</key>
  220. <value>
  221. <description></description>
  222. <displayName>sshUsername</displayName>
  223. <dynamic>true</dynamic>
  224. <name>sshUsername</name>
  225. <required>false</required>
  226. <sensitive>false</sensitive>
  227. <supportsEl>true</supportsEl>
  228. </value>
  229. </entry>
  230. </descriptors>
  231. <lossTolerant>false</lossTolerant>
  232. <penaltyDuration>30 sec</penaltyDuration>
  233. <properties>
  234. <entry>
  235. <key>Script Engine</key>
  236. <value>Groovy</value>
  237. </entry>
  238. <entry>
  239. <key>Script File</key>
  240. </entry>
  241. <entry>
  242. <key>Script Body</key>
  243. <value>import static com.aestasit.infrastructure.ssh.DefaultSsh.*
  244.  
  245. def flowFile = session.get()
  246. if(!flowFile) return
  247.  
  248. def commands = []
  249. // Read in one command per line
  250. session.read(flowFile, {inputStream ->
  251. inputStream.eachLine { line -> commands << line }
  252. } as InputStreamCallback)
  253.  
  254. options.trustUnknownHosts = true
  255. def result = null
  256. remoteSession {
  257.  
  258. host = sshHostname.value
  259. username = sshUsername.value
  260. password = sshPassword.value
  261. port = Integer.parseInt(sshPort.value)
  262.  
  263. result = exec(showOutput: true, failOnError: false, command: commands.join('\n'))
  264. }
  265.  
  266. flowFile = session.write(flowFile, { outputStream ->
  267. result?.output?.eachLine { line ->
  268. outputStream.write(line.bytes)
  269. outputStream.write('\n'.bytes)
  270. }
  271. } as OutputStreamCallback)
  272.  
  273. session.transfer(flowFile, result?.exitStatus ? REL_FAILURE : REL_SUCCESS)</value>
  274. </entry>
  275. <entry>
  276. <key>Module Directory</key>
  277. <value>/Users/mburgess/Downloads/sshoogr-0.9.25/lib</value>
  278. </entry>
  279. <entry>
  280. <key>sshHostname</key>
  281. <value>sandbox.hortonworks.com</value>
  282. </entry>
  283. <entry>
  284. <key>sshPassword</key>
  285. <value>hadoop</value>
  286. </entry>
  287. <entry>
  288. <key>sshPort</key>
  289. <value>22</value>
  290. </entry>
  291. <entry>
  292. <key>sshUsername</key>
  293. <value>root</value>
  294. </entry>
  295. </properties>
  296. <runDurationMillis>0</runDurationMillis>
  297. <schedulingPeriod>0 sec</schedulingPeriod>
  298. <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
  299. <yieldDuration>1 sec</yieldDuration>
  300. </config>
  301. <name>ExecuteScript</name>
  302. <relationships>
  303. <autoTerminate>false</autoTerminate>
  304. <name>failure</name>
  305. </relationships>
  306. <relationships>
  307. <autoTerminate>false</autoTerminate>
  308. <name>success</name>
  309. </relationships>
  310. <style></style>
  311. <type>org.apache.nifi.processors.script.ExecuteScript</type>
  312. </processors>
  313. <processors>
  314. <id>7492b587-0156-1000-0000-000000000000</id>
  315. <parentGroupId>71f9bd06-0156-1000-0000-000000000000</parentGroupId>
  316. <position>
  317. <x>0.0</x>
  318. <y>722.0</y>
  319. </position>
  320. <config>
  321. <bulletinLevel>WARN</bulletinLevel>
  322. <comments></comments>
  323. <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
  324. <descriptors>
  325. <entry>
  326. <key>Log Level</key>
  327. <value>
  328. <allowableValues>
  329. <displayName>trace</displayName>
  330. <value>trace</value>
  331. </allowableValues>
  332. <allowableValues>
  333. <displayName>debug</displayName>
  334. <value>debug</value>
  335. </allowableValues>
  336. <allowableValues>
  337. <displayName>info</displayName>
  338. <value>info</value>
  339. </allowableValues>
  340. <allowableValues>
  341. <displayName>warn</displayName>
  342. <value>warn</value>
  343. </allowableValues>
  344. <allowableValues>
  345. <displayName>error</displayName>
  346. <value>error</value>
  347. </allowableValues>
  348. <defaultValue>info</defaultValue>
  349. <description>The Log Level to use when logging the Attributes</description>
  350. <displayName>Log Level</displayName>
  351. <dynamic>false</dynamic>
  352. <name>Log Level</name>
  353. <required>true</required>
  354. <sensitive>false</sensitive>
  355. <supportsEl>false</supportsEl>
  356. </value>
  357. </entry>
  358. <entry>
  359. <key>Log Payload</key>
  360. <value>
  361. <allowableValues>
  362. <displayName>true</displayName>
  363. <value>true</value>
  364. </allowableValues>
  365. <allowableValues>
  366. <displayName>false</displayName>
  367. <value>false</value>
  368. </allowableValues>
  369. <defaultValue>false</defaultValue>
  370. <description>If true, the FlowFile's payload will be logged, in addition to its attributes; otherwise, just the Attributes will be logged.</description>
  371. <displayName>Log Payload</displayName>
  372. <dynamic>false</dynamic>
  373. <name>Log Payload</name>
  374. <required>true</required>
  375. <sensitive>false</sensitive>
  376. <supportsEl>false</supportsEl>
  377. </value>
  378. </entry>
  379. <entry>
  380. <key>Attributes to Log</key>
  381. <value>
  382. <description>A comma-separated list of Attributes to Log. If not specified, all attributes will be logged.</description>
  383. <displayName>Attributes to Log</displayName>
  384. <dynamic>false</dynamic>
  385. <name>Attributes to Log</name>
  386. <required>false</required>
  387. <sensitive>false</sensitive>
  388. <supportsEl>false</supportsEl>
  389. </value>
  390. </entry>
  391. <entry>
  392. <key>Attributes to Ignore</key>
  393. <value>
  394. <description>A comma-separated list of Attributes to ignore. If not specified, no attributes will be ignored.</description>
  395. <displayName>Attributes to Ignore</displayName>
  396. <dynamic>false</dynamic>
  397. <name>Attributes to Ignore</name>
  398. <required>false</required>
  399. <sensitive>false</sensitive>
  400. <supportsEl>false</supportsEl>
  401. </value>
  402. </entry>
  403. <entry>
  404. <key>Log prefix</key>
  405. <value>
  406. <description>Log prefix appended to the log lines. It helps to distinguish the output of multiple LogAttribute processors.</description>
  407. <displayName>Log prefix</displayName>
  408. <dynamic>false</dynamic>
  409. <name>Log prefix</name>
  410. <required>false</required>
  411. <sensitive>false</sensitive>
  412. <supportsEl>true</supportsEl>
  413. </value>
  414. </entry>
  415. </descriptors>
  416. <lossTolerant>false</lossTolerant>
  417. <penaltyDuration>30 sec</penaltyDuration>
  418. <properties>
  419. <entry>
  420. <key>Log Level</key>
  421. <value>info</value>
  422. </entry>
  423. <entry>
  424. <key>Log Payload</key>
  425. <value>true</value>
  426. </entry>
  427. <entry>
  428. <key>Attributes to Log</key>
  429. </entry>
  430. <entry>
  431. <key>Attributes to Ignore</key>
  432. </entry>
  433. <entry>
  434. <key>Log prefix</key>
  435. </entry>
  436. </properties>
  437. <runDurationMillis>0</runDurationMillis>
  438. <schedulingPeriod>0 sec</schedulingPeriod>
  439. <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
  440. <yieldDuration>1 sec</yieldDuration>
  441. </config>
  442. <name>LogAttribute</name>
  443. <relationships>
  444. <autoTerminate>true</autoTerminate>
  445. <name>success</name>
  446. </relationships>
  447. <style></style>
  448. <type>org.apache.nifi.processors.standard.LogAttribute</type>
  449. </processors>
  450. <processors>
  451. <id>74c06dde-0156-1000-0000-000000000000</id>
  452. <parentGroupId>71f9bd06-0156-1000-0000-000000000000</parentGroupId>
  453. <position>
  454. <x>0.0</x>
  455. <y>0.0</y>
  456. </position>
  457. <config>
  458. <bulletinLevel>WARN</bulletinLevel>
  459. <comments></comments>
  460. <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
  461. <descriptors>
  462. <entry>
  463. <key>File Size</key>
  464. <value>
  465. <description>The size of the file that will be used</description>
  466. <displayName>File Size</displayName>
  467. <dynamic>false</dynamic>
  468. <name>File Size</name>
  469. <required>true</required>
  470. <sensitive>false</sensitive>
  471. <supportsEl>false</supportsEl>
  472. </value>
  473. </entry>
  474. <entry>
  475. <key>Batch Size</key>
  476. <value>
  477. <defaultValue>1</defaultValue>
  478. <description>The number of FlowFiles to be transferred in each invocation</description>
  479. <displayName>Batch Size</displayName>
  480. <dynamic>false</dynamic>
  481. <name>Batch Size</name>
  482. <required>true</required>
  483. <sensitive>false</sensitive>
  484. <supportsEl>false</supportsEl>
  485. </value>
  486. </entry>
  487. <entry>
  488. <key>Data Format</key>
  489. <value>
  490. <allowableValues>
  491. <displayName>Binary</displayName>
  492. <value>Binary</value>
  493. </allowableValues>
  494. <allowableValues>
  495. <displayName>Text</displayName>
  496. <value>Text</value>
  497. </allowableValues>
  498. <defaultValue>Binary</defaultValue>
  499. <description>Specifies whether the data should be Text or Binary</description>
  500. <displayName>Data Format</displayName>
  501. <dynamic>false</dynamic>
  502. <name>Data Format</name>
  503. <required>true</required>
  504. <sensitive>false</sensitive>
  505. <supportsEl>false</supportsEl>
  506. </value>
  507. </entry>
  508. <entry>
  509. <key>Unique FlowFiles</key>
  510. <value>
  511. <allowableValues>
  512. <displayName>true</displayName>
  513. <value>true</value>
  514. </allowableValues>
  515. <allowableValues>
  516. <displayName>false</displayName>
  517. <value>false</value>
  518. </allowableValues>
  519. <defaultValue>false</defaultValue>
  520. <description>If true, each FlowFile that is generated will be unique. If false, a random value will be generated and all FlowFiles will get the same content but this offers much higher throughput</description>
  521. <displayName>Unique FlowFiles</displayName>
  522. <dynamic>false</dynamic>
  523. <name>Unique FlowFiles</name>
  524. <required>true</required>
  525. <sensitive>false</sensitive>
  526. <supportsEl>false</supportsEl>
  527. </value>
  528. </entry>
  529. </descriptors>
  530. <lossTolerant>false</lossTolerant>
  531. <penaltyDuration>30 sec</penaltyDuration>
  532. <properties>
  533. <entry>
  534. <key>File Size</key>
  535. <value>0B</value>
  536. </entry>
  537. <entry>
  538. <key>Batch Size</key>
  539. <value>1</value>
  540. </entry>
  541. <entry>
  542. <key>Data Format</key>
  543. <value>Text</value>
  544. </entry>
  545. <entry>
  546. <key>Unique FlowFiles</key>
  547. <value>false</value>
  548. </entry>
  549. </properties>
  550. <runDurationMillis>0</runDurationMillis>
  551. <schedulingPeriod>10 sec</schedulingPeriod>
  552. <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
  553. <yieldDuration>1 sec</yieldDuration>
  554. </config>
  555. <name>GenerateFlowFile</name>
  556. <relationships>
  557. <autoTerminate>false</autoTerminate>
  558. <name>success</name>
  559. </relationships>
  560. <style></style>
  561. <type>org.apache.nifi.processors.standard.GenerateFlowFile</type>
  562. </processors>
  563. <processors>
  564. <id>74c07bf5-0156-1000-0000-000000000000</id>
  565. <parentGroupId>71f9bd06-0156-1000-0000-000000000000</parentGroupId>
  566. <position>
  567. <x>1.0</x>
  568. <y>218.0</y>
  569. </position>
  570. <config>
  571. <bulletinLevel>WARN</bulletinLevel>
  572. <comments></comments>
  573. <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
  574. <descriptors>
  575. <entry>
  576. <key>Regular Expression</key>
  577. <value>
  578. <defaultValue>(?s:^.*$)</defaultValue>
  579. <description>The Search Value to search for in the FlowFile content. Only used for 'Literal Replace' and 'Regex Replace' matching strategies</description>
  580. <displayName>Search Value</displayName>
  581. <dynamic>false</dynamic>
  582. <name>Regular Expression</name>
  583. <required>true</required>
  584. <sensitive>false</sensitive>
  585. <supportsEl>true</supportsEl>
  586. </value>
  587. </entry>
  588. <entry>
  589. <key>Replacement Value</key>
  590. <value>
  591. <defaultValue>$1</defaultValue>
  592. <description>The value to insert using the 'Replacement Strategy'. Using "Regex Replace" back-references to Regular Expression capturing groups are supported, but back-references that reference capturing groups that do not exist in the regular expression will be treated as literal value. Back References may also be referenced using the Expression Language, as '$1', '$2', etc. The single-tick marks MUST be included, as these variables are not "Standard" attribute names (attribute names must be quoted unless they contain only numbers, letters, and _).</description>
  593. <displayName>Replacement Value</displayName>
  594. <dynamic>false</dynamic>
  595. <name>Replacement Value</name>
  596. <required>true</required>
  597. <sensitive>false</sensitive>
  598. <supportsEl>true</supportsEl>
  599. </value>
  600. </entry>
  601. <entry>
  602. <key>Character Set</key>
  603. <value>
  604. <defaultValue>UTF-8</defaultValue>
  605. <description>The Character Set in which the file is encoded</description>
  606. <displayName>Character Set</displayName>
  607. <dynamic>false</dynamic>
  608. <name>Character Set</name>
  609. <required>true</required>
  610. <sensitive>false</sensitive>
  611. <supportsEl>false</supportsEl>
  612. </value>
  613. </entry>
  614. <entry>
  615. <key>Maximum Buffer Size</key>
  616. <value>
  617. <defaultValue>1 MB</defaultValue>
  618. <description>Specifies the maximum amount of data to buffer (per file or per line, depending on the Evaluation Mode) in order to apply the replacement. If 'Entire Text' (in Evaluation Mode) is selected and the FlowFile is larger than this value, the FlowFile will be routed to 'failure'. In 'Line-by-Line' Mode, if a single line is larger than this value, the FlowFile will be routed to 'failure'. A default value of 1 MB is provided, primarily for 'Entire Text' mode. In 'Line-by-Line' Mode, a value such as 8 KB or 16 KB is suggested. This value is ignored if the <Replacement Strategy> property is set to one of: Append, Prepend, Always Replace</description>
  619. <displayName>Maximum Buffer Size</displayName>
  620. <dynamic>false</dynamic>
  621. <name>Maximum Buffer Size</name>
  622. <required>true</required>
  623. <sensitive>false</sensitive>
  624. <supportsEl>false</supportsEl>
  625. </value>
  626. </entry>
  627. <entry>
  628. <key>Replacement Strategy</key>
  629. <value>
  630. <allowableValues>
  631. <description>Insert the Replacement Value at the beginning of the FlowFile or the beginning of each line (depending on the Evaluation Mode). For "Line-by-Line" Evaluation Mode, the value will be prepended to each line. For "Entire Text" evaluation mode, the value will be prepended to the entire text.</description>
  632. <displayName>Prepend</displayName>
  633. <value>Prepend</value>
  634. </allowableValues>
  635. <allowableValues>
  636. <description>Insert the Replacement Value at the end of the FlowFile or the end of each line (depending on the Evluation Mode). For "Line-by-Line" Evaluation Mode, the value will be appended to each line. For "Entire Text" evaluation mode, the value will be appended to the entire text.</description>
  637. <displayName>Append</displayName>
  638. <value>Append</value>
  639. </allowableValues>
  640. <allowableValues>
  641. <description>Interpret the Search Value as a Regular Expression and replace all matches with the Replacement Value. The Replacement Value may reference Capturing Groups used in the Search Value by using a dollar-sign followed by the Capturing Group number, such as $1 or $2. If the Search Value is set to .* then everything is replaced without even evaluating the Regular Expression.</description>
  642. <displayName>Regex Replace</displayName>
  643. <value>Regex Replace</value>
  644. </allowableValues>
  645. <allowableValues>
  646. <description>Search for all instances of the Search Value and replace the matches with the Replacement Value.</description>
  647. <displayName>Literal Replace</displayName>
  648. <value>Literal Replace</value>
  649. </allowableValues>
  650. <allowableValues>
  651. <description>Always replaces the entire line or the entire contents of the FlowFile (depending on the value of the <Evaluation Mode> property) and does not bother searching for any value. When this strategy is chosen, the <Search Value> property is ignored.</description>
  652. <displayName>Always Replace</displayName>
  653. <value>Always Replace</value>
  654. </allowableValues>
  655. <defaultValue>Regex Replace</defaultValue>
  656. <description>The strategy for how and what to replace within the FlowFile's text content.</description>
  657. <displayName>Replacement Strategy</displayName>
  658. <dynamic>false</dynamic>
  659. <name>Replacement Strategy</name>
  660. <required>true</required>
  661. <sensitive>false</sensitive>
  662. <supportsEl>false</supportsEl>
  663. </value>
  664. </entry>
  665. <entry>
  666. <key>Evaluation Mode</key>
  667. <value>
  668. <allowableValues>
  669. <displayName>Line-by-Line</displayName>
  670. <value>Line-by-Line</value>
  671. </allowableValues>
  672. <allowableValues>
  673. <displayName>Entire text</displayName>
  674. <value>Entire text</value>
  675. </allowableValues>
  676. <defaultValue>Entire text</defaultValue>
  677. <description>Run the 'Replacement Strategy' against each line separately (Line-by-Line) or buffer the entire file into memory (Entire Text) and run against that.</description>
  678. <displayName>Evaluation Mode</displayName>
  679. <dynamic>false</dynamic>
  680. <name>Evaluation Mode</name>
  681. <required>true</required>
  682. <sensitive>false</sensitive>
  683. <supportsEl>false</supportsEl>
  684. </value>
  685. </entry>
  686. </descriptors>
  687. <lossTolerant>false</lossTolerant>
  688. <penaltyDuration>30 sec</penaltyDuration>
  689. <properties>
  690. <entry>
  691. <key>Regular Expression</key>
  692. <value>(?s:^.*$)</value>
  693. </entry>
  694. <entry>
  695. <key>Replacement Value</key>
  696. <value>hadoop fs -ls /user
  697. echo "Hello World!" > here_i_am.txt
  698. </value>
  699. </entry>
  700. <entry>
  701. <key>Character Set</key>
  702. <value>UTF-8</value>
  703. </entry>
  704. <entry>
  705. <key>Maximum Buffer Size</key>
  706. <value>1 MB</value>
  707. </entry>
  708. <entry>
  709. <key>Replacement Strategy</key>
  710. <value>Regex Replace</value>
  711. </entry>
  712. <entry>
  713. <key>Evaluation Mode</key>
  714. <value>Entire text</value>
  715. </entry>
  716. </properties>
  717. <runDurationMillis>0</runDurationMillis>
  718. <schedulingPeriod>0 sec</schedulingPeriod>
  719. <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
  720. <yieldDuration>1 sec</yieldDuration>
  721. </config>
  722. <name>ReplaceText</name>
  723. <relationships>
  724. <autoTerminate>true</autoTerminate>
  725. <name>failure</name>
  726. </relationships>
  727. <relationships>
  728. <autoTerminate>false</autoTerminate>
  729. <name>success</name>
  730. </relationships>
  731. <style></style>
  732. <type>org.apache.nifi.processors.standard.ReplaceText</type>
  733. </processors>
  734. </snippet>
  735. <timestamp>08/10/2016 15:09:05 EDT</timestamp>
  736. </template>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement