I am trying to use the pre Import Actions within the Data import configuration section to modify several attributes being imported from AD.
AD Attribute "StreetAddress" needs to be mapped to Hornbill site value. Currently "streetAddress" contains carriage returns which need to be removed so lookup can match to a site location.
AD Attribute "Department" needs to be mapped to Hornbill Department and Sub-Department value. Currently "Department" is in the format Department : Sub-department and needs to be split on the colon so lookup can match everything before colon to department and everything after to sub-department.
For "StreetAddress" I'm using the option to do a replace using \r\n in the find field and , in the replace with field however, it is not having any affect when LDAP_Import utility is run.
To get department I'm using:
(.+)(?=:)
and sub-department:
(?<=:)(.+)
however, receive the below error:
[DEBUG] Processing LDAP User Data
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x10 pc=0x51c605]
goroutine 1 [running]:
regexp.(*Regexp).allMatches(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x64, 0xc042433138)
/usr/local/go/src/regexp/regexp.go:683 +0xb5
regexp.(*Regexp).FindAllString(0x0, 0x0, 0x0, 0x64, 0x3f, 0xc04234e050, 0x4c)
/usr/local/go/src/regexp/regexp.go:1024 +0x116
main.processRegexOnString(0xc042317260, 0x9, 0x0, 0x0, 0x0, 0x722848)
/Users/TrevorK/development/GoLang/src/github.com/hornbill/goLDAPUserImport/common.go:28 +0x148
main.processImportActions(0xc04216e930, 0x0, 0xc0426cbd10)
/Users/TrevorK/development/GoLang/src/github.com/hornbill/goLDAPUserImport/process_data.go:565 +0x457
main.processLDAPUsers()
/Users/TrevorK/development/GoLang/src/github.com/hornbill/goLDAPUserImport/process_data.go:23 +0x1c1
main.main()
/Users/TrevorK/development/GoLang/src/github.com/hornbill/goLDAPUserImport/main.go:83 +0x357
Looking at the error it looks like GoLang is the flavor of Regex being used? It does appear to support ?=. I have tried working around it but cant seem to get the desired results (tried using (.+)(?=:) for dept & (?<=:)(.+) for sub-dept)
Can anyone assist?
Many thanks
Chris