Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Python Executescript processor


Python Executescript processor

New Contributor

I am working on a python script to post messages to a irc chat. From what I understand I need to use session.get() in order to retrieve flowfiles from a queue. 

I have tried several things but have not been able to retrieve any files from the queue to successfully post. 




import socket
from import StreamCallback, InputStreamCallback

class PyStreamCallback(InputStreamCallback):
    def __init__(self):
       self.ircsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
       self.server = "" = ""
       self.botnick = ""
       self.ircsock.connect((self.server, 6667))
       self.ircsock.send(bytes("USER "+ botnick +" "+ botnick +" "+ botnick + " " + botnick + "\n"))
       self.ircsock.send(bytes("NICK "+ botnick +"\n"))

    def joinchan(self, chan):
      self.ircsock.send(bytes("JOIN "+ chan +"\n"))
      ircmsg = ""
      while ircmsg.find("End of /NAMES list.") == -1:
        self.ircmsg = ircsock.recv(2048)
        self.ircmsg = ircmsg.strip('\n\r')

    def sendmsg(self, msg,
      self.ircsock.send(bytes("PRIVMSG "+ target +" :"+ msg +"\n"))

flowFile = session.get()
if (flowFile != None):
  flowFile =,PyStreamCallback())


Don't have an account?
Coming from Hortonworks? Activate your account here