Generating a custom named csv in Delimited Text Driver


Hi ,

I am trying to develop a delimited text driver that will listen to add /
modify events and generate a csv file output. I have used the default
configurations in driver and has defined the schema and the filter for
the required attributes.

Whenever there is a add event we are able to get a .csv file (for the
defined attributes) as output, but the file name is a timestamp.
Something like 185914481233.csv. I am not sure from where this name is
getting generated.

My requirement is if the event is

1. for create user , the csv file generated should have a name as
c-username-timestamp.csv
2. for update user , the csv file generated should have a name as
U-username-timestamp.csv

Can you please let me know how i can do this customization for file name
?


--
kalariviswa
------------------------------------------------------------------------
kalariviswa's Profile: https://forums.netiq.com/member.php?userid=9296
View this thread: https://forums.netiq.com/showthread.php?t=56218

Parents
  • kalariviswa;2433523 wrote:
    Hi ,

    I am trying to develop a delimited text driver that will listen to add /
    modify events and generate a csv file output. I have used the default
    configurations in driver and has defined the schema and the filter for
    the required attributes.

    Whenever there is a add event we are able to get a .csv file (for the
    defined attributes) as output, but the file name is a timestamp.
    Something like 185914481233.csv. I am not sure from where this name is
    getting generated.

    My requirement is if the event is

    1. for create user , the csv file generated should have a name as
    c-username-timestamp.csv
    2. for update user , the csv file generated should have a name as
    U-username-timestamp.csv

    Can you please let me know how i can do this customization for file name
    ?


    --
    kalariviswa
    ------------------------------------------------------------------------
    kalariviswa's Profile: https://forums.netiq.com/member.php?userid=9296
    View this thread: https://forums.netiq.com/showthread.php?t=56218


    Hi kalariviswa,
    Like usual you have more than one way to get required result!
    1. You can use Stefaan's Generic File Driver

    It has much more flexibility in file operation configuration (and other functionality), than "standard" Delimited Text Driver.
    You can review these options on this link http://vancauwenberge.info/#txtdriver_configuration_subscriber.

    2. Use ecmascript file-access functions and have complete control for file operations.
    I used this method for generate "custom" logs for on-boarding driver (generated file name included cn and date information).


    We have number of ECMA functions with similar functionality.
    function writeFile(fileName, contentString)
    function fileRead(filepath)
    function ReadFromFile(fileName)
    function appendToFile(fileName, text)


    Geoffrey shared number of these functions in his CSs
    https://www.netiq.com/communities/cool-solutions/open-call-useful-ecma-functions-use-identity-manager/
    https://www.netiq.com/communities/cool-solutions/wp-content/uploads/sites/2/2009/06/ECMALibrary.txt
  • al b wrote:

    > 2. Use ecmascript file-access functions and have complete control for
    > file operations.
    > I used this method for generate "custom" logs for on-boarding driver
    > (generated file name included cn and date information).
    >
    >
    > We have number of ECMA functions with similar functionality.
    > > function writeFile(fileName, contentString)
    > > function fileRead(filepath)
    > > function ReadFromFile(fileName)
    > > function appendToFile(fileName, text)

    >


    Just a note: not all of these are thread-safe and thus extreme care
    should be used when calling these functions from multiple drivers or
    even from publisher and subscriber channel in the same driver.

Reply
  • al b wrote:

    > 2. Use ecmascript file-access functions and have complete control for
    > file operations.
    > I used this method for generate "custom" logs for on-boarding driver
    > (generated file name included cn and date information).
    >
    >
    > We have number of ECMA functions with similar functionality.
    > > function writeFile(fileName, contentString)
    > > function fileRead(filepath)
    > > function ReadFromFile(fileName)
    > > function appendToFile(fileName, text)

    >


    Just a note: not all of these are thread-safe and thus extreme care
    should be used when calling these functions from multiple drivers or
    even from publisher and subscriber channel in the same driver.

Children
No Data