Skip to content

Execute statements atfer reading each record found by statement#221

Open
rigon wants to merge 3 commits intologstash-plugins:mainfrom
rigon:master
Open

Execute statements atfer reading each record found by statement#221
rigon wants to merge 3 commits intologstash-plugins:mainfrom
rigon:master

Conversation

@rigon
Copy link
Copy Markdown

@rigon rigon commented Jun 21, 2017

This allows to execute queries that modify data in the database after reading each record.
For example, this allows to update or delete records already imported.

Example to update records:

input {
    jdbc {
        statement => "SELECT id FROM test"
        post_statement => "UPDATE test SET flag = 1 WHERE id = :id"
    }
}

Example to delete records:

input {
    jdbc {
        statement => "SELECT id FROM test"
        post_statement => "DELETE FROM test WHERE id = :id"
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant