Esempio n. 1
0
 def login(self):
     print 'Splunk Login:'******'Username: '******'connecting to', self.config['host']+':'+str(self.config['splunk_rest_port'])
     try:
         self.service = connect_to_splunk(self.config, user, password)
     except client.AuthenticationError:
         print "login failed"
         sys.exit()
     self.sock, self.tcpinput = create_splunk_input(self.service, self.config)
Esempio n. 2
0
 def login(self):
     print 'Splunk Login:'******'Username: '******'connecting to', self.config['host'] + ':' + str(
         self.config['splunk_rest_port'])
     try:
         self.service = connect_to_splunk(self.config, user, password)
     except client.AuthenticationError:
         print "login failed"
         sys.exit()
     self.sock, self.tcpinput = create_splunk_input(self.service,
                                                    self.config)
Esempio n. 3
0
 def login(self):
     d = LoginDialog(self.parent)
     result = d.getResult()
     if result:
         user, pswd = result
         if not user or not pswd:
             self.login()
         try:                
             self.output(' '.join(['connecting to', self.config['host']+':'+str(self.config['splunk_rest_port'])]))
             self.service = connect_to_splunk(self.config, user, pswd)
             #self.output(str(self.service))
             self.sock, self.tcpinput = create_splunk_input(self.service, self.config)
             self.output('input created successfully')
         except client.AuthenticationError:
             self.output('login failed')
     else:
         self.output('cancelled')