From 237d999ee7c7b0afc6d0c7b52e167061e43497a1 Mon Sep 17 00:00:00 2001 From: Nils Vasell Date: Fri, 21 Mar 2025 12:07:39 +0100 Subject: [PATCH] rename functions to support enabling and disabling them in Azure portal --- .../{aad-logs => aad_logs}/function.json | 0 .../{aad-logs => aad_logs}/index.js | 58 +++++++++---------- .../function.json | 0 .../index.js | 58 +++++++++---------- .../function.json | 0 .../index.js | 58 +++++++++---------- .../function.json | 0 .../{activity-logs => activity_logs}/index.js | 58 +++++++++---------- event-hubs-hec/deploy/azureDeploy.json | 10 ++-- .../function.json | 0 .../index.js | 58 +++++++++---------- 11 files changed, 150 insertions(+), 150 deletions(-) rename event-hubs-hec/{aad-logs => aad_logs}/function.json (100%) rename event-hubs-hec/{aad-logs => aad_logs}/index.js (97%) rename event-hubs-hec/{aad-signin-logs-non-interactive => aad_signin_logs_non_interactive}/function.json (100%) rename event-hubs-hec/{aad-signin-logs-non-interactive => aad_signin_logs_non_interactive}/index.js (97%) rename event-hubs-hec/{aad-signin-logs-service-principal => aad_signin_logs_service_principle}/function.json (100%) rename event-hubs-hec/{aad-signin-logs-service-principal => aad_signin_logs_service_principle}/index.js (97%) rename event-hubs-hec/{activity-logs => activity_logs}/function.json (100%) rename event-hubs-hec/{activity-logs => activity_logs}/index.js (97%) rename event-hubs-hec/{diagnostic-logs => diagnostic_logs}/function.json (100%) rename event-hubs-hec/{diagnostic-logs => diagnostic_logs}/index.js (97%) diff --git a/event-hubs-hec/aad-logs/function.json b/event-hubs-hec/aad_logs/function.json similarity index 100% rename from event-hubs-hec/aad-logs/function.json rename to event-hubs-hec/aad_logs/function.json diff --git a/event-hubs-hec/aad-logs/index.js b/event-hubs-hec/aad_logs/index.js similarity index 97% rename from event-hubs-hec/aad-logs/index.js rename to event-hubs-hec/aad_logs/index.js index ff9a0f0..4c33022 100644 --- a/event-hubs-hec/aad-logs/index.js +++ b/event-hubs-hec/aad_logs/index.js @@ -1,30 +1,30 @@ -/* -Copyright 2020 Splunk Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -const splunk = require('../helpers/splunk'); -module.exports = async function (context, eventHubMessages) { - - for (const event of eventHubMessages) { - await splunk - .sendToHEC(event, process.env["AAD_LOG_SOURCETYPE"]) - .catch(err => { - context.log.error(`Error posting to Splunk HTTP Event Collector: ${err}`); - - // If the event was not successfully sent to Splunk, drop the event in a storage blob - context.bindings.outputBlob = event; - }) - } - context.done(); +/* +Copyright 2020 Splunk Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +const splunk = require('../helpers/splunk'); +module.exports = async function (context, eventHubMessages) { + + for (const event of eventHubMessages) { + await splunk + .sendToHEC(event, process.env["AAD_LOG_SOURCETYPE"]) + .catch(err => { + context.log.error(`Error posting to Splunk HTTP Event Collector: ${err}`); + + // If the event was not successfully sent to Splunk, drop the event in a storage blob + context.bindings.outputBlob = event; + }) + } + context.done(); }; \ No newline at end of file diff --git a/event-hubs-hec/aad-signin-logs-non-interactive/function.json b/event-hubs-hec/aad_signin_logs_non_interactive/function.json similarity index 100% rename from event-hubs-hec/aad-signin-logs-non-interactive/function.json rename to event-hubs-hec/aad_signin_logs_non_interactive/function.json diff --git a/event-hubs-hec/aad-signin-logs-non-interactive/index.js b/event-hubs-hec/aad_signin_logs_non_interactive/index.js similarity index 97% rename from event-hubs-hec/aad-signin-logs-non-interactive/index.js rename to event-hubs-hec/aad_signin_logs_non_interactive/index.js index 2fb58c3..3fbb456 100644 --- a/event-hubs-hec/aad-signin-logs-non-interactive/index.js +++ b/event-hubs-hec/aad_signin_logs_non_interactive/index.js @@ -1,30 +1,30 @@ -/* -Copyright 2020 Splunk Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -const splunk = require('../helpers/splunk'); -module.exports = async function (context, eventHubMessages) { - - for (const event of eventHubMessages) { - await splunk - .sendToHEC(event, process.env["AAD_NON_INTERACTIVE_SIGNIN_LOG_SOURCETYPE"]) - .catch(err => { - context.log.error(`Error posting to Splunk HTTP Event Collector: ${err}`); - - // If the event was not successfully sent to Splunk, drop the event in a storage blob - context.bindings.outputBlob = event; - }) - } - context.done(); +/* +Copyright 2020 Splunk Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +const splunk = require('../helpers/splunk'); +module.exports = async function (context, eventHubMessages) { + + for (const event of eventHubMessages) { + await splunk + .sendToHEC(event, process.env["AAD_NON_INTERACTIVE_SIGNIN_LOG_SOURCETYPE"]) + .catch(err => { + context.log.error(`Error posting to Splunk HTTP Event Collector: ${err}`); + + // If the event was not successfully sent to Splunk, drop the event in a storage blob + context.bindings.outputBlob = event; + }) + } + context.done(); }; \ No newline at end of file diff --git a/event-hubs-hec/aad-signin-logs-service-principal/function.json b/event-hubs-hec/aad_signin_logs_service_principle/function.json similarity index 100% rename from event-hubs-hec/aad-signin-logs-service-principal/function.json rename to event-hubs-hec/aad_signin_logs_service_principle/function.json diff --git a/event-hubs-hec/aad-signin-logs-service-principal/index.js b/event-hubs-hec/aad_signin_logs_service_principle/index.js similarity index 97% rename from event-hubs-hec/aad-signin-logs-service-principal/index.js rename to event-hubs-hec/aad_signin_logs_service_principle/index.js index 09da287..1fbe4bd 100644 --- a/event-hubs-hec/aad-signin-logs-service-principal/index.js +++ b/event-hubs-hec/aad_signin_logs_service_principle/index.js @@ -1,30 +1,30 @@ -/* -Copyright 2020 Splunk Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -const splunk = require('../helpers/splunk'); -module.exports = async function (context, eventHubMessages) { - - for (const event of eventHubMessages) { - await splunk - .sendToHEC(event, process.env["AAD_SERVICE_PRINCIPAL_SIGNIN_LOG_SOURCETYPE"]) - .catch(err => { - context.log.error(`Error posting to Splunk HTTP Event Collector: ${err}`); - - // If the event was not successfully sent to Splunk, drop the event in a storage blob - context.bindings.outputBlob = event; - }) - } - context.done(); +/* +Copyright 2020 Splunk Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +const splunk = require('../helpers/splunk'); +module.exports = async function (context, eventHubMessages) { + + for (const event of eventHubMessages) { + await splunk + .sendToHEC(event, process.env["AAD_SERVICE_PRINCIPAL_SIGNIN_LOG_SOURCETYPE"]) + .catch(err => { + context.log.error(`Error posting to Splunk HTTP Event Collector: ${err}`); + + // If the event was not successfully sent to Splunk, drop the event in a storage blob + context.bindings.outputBlob = event; + }) + } + context.done(); }; \ No newline at end of file diff --git a/event-hubs-hec/activity-logs/function.json b/event-hubs-hec/activity_logs/function.json similarity index 100% rename from event-hubs-hec/activity-logs/function.json rename to event-hubs-hec/activity_logs/function.json diff --git a/event-hubs-hec/activity-logs/index.js b/event-hubs-hec/activity_logs/index.js similarity index 97% rename from event-hubs-hec/activity-logs/index.js rename to event-hubs-hec/activity_logs/index.js index 20491f5..0558bfe 100644 --- a/event-hubs-hec/activity-logs/index.js +++ b/event-hubs-hec/activity_logs/index.js @@ -1,30 +1,30 @@ -/* -Copyright 2020 Splunk Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -const splunk = require('../helpers/splunk'); -module.exports = async function (context, eventHubMessages) { - - for (const event of eventHubMessages) { - await splunk - .sendToHEC(event, process.env["ACTIVITY_LOG_SOURCETYPE"]) - .catch(err => { - context.log.error(`Error posting to Splunk HTTP Event Collector: ${err}`); - - // If the event was not successfully sent to Splunk, drop the event in a storage blob - context.bindings.outputBlob = event; - }) - } - context.done(); +/* +Copyright 2020 Splunk Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +const splunk = require('../helpers/splunk'); +module.exports = async function (context, eventHubMessages) { + + for (const event of eventHubMessages) { + await splunk + .sendToHEC(event, process.env["ACTIVITY_LOG_SOURCETYPE"]) + .catch(err => { + context.log.error(`Error posting to Splunk HTTP Event Collector: ${err}`); + + // If the event was not successfully sent to Splunk, drop the event in a storage blob + context.bindings.outputBlob = event; + }) + } + context.done(); }; \ No newline at end of file diff --git a/event-hubs-hec/deploy/azureDeploy.json b/event-hubs-hec/deploy/azureDeploy.json index 75eeeb2..c7f18b7 100644 --- a/event-hubs-hec/deploy/azureDeploy.json +++ b/event-hubs-hec/deploy/azureDeploy.json @@ -314,7 +314,7 @@ "value": "[parameters('activityLogSourceType')]" }, { - "name": "AzureWebJobs.activity-logs.Disabled", + "name": "AzureWebJobs.activity_logs.Disabled", "value": "[parameters('activityLogDisabled')]" }, @@ -331,7 +331,7 @@ "value": "[parameters('aadLogSourceType')]" }, { - "name": "AzureWebJobs.aad-logs.Disabled", + "name": "AzureWebJobs.aad_logs.Disabled", "value": "[parameters('aadLogDisabled')]" }, @@ -348,7 +348,7 @@ "value": "[parameters('aadNoninteractiveLogSourceType')]" }, { - "name": "AzureWebJobs.aad-signin-logs-non-interactive.Disabled", + "name": "AzureWebJobs.aad_signin_logs_non_interactive.Disabled", "value": "[parameters('aadNoninteractiveLogDisabled')]" }, @@ -365,7 +365,7 @@ "value": "[parameters('aadServicePrincipalLogSourceType')]" }, { - "name": "AzureWebJobs.aad-signin-logs-service-principal.Disabled", + "name": "AzureWebJobs.aad_signin_logs_service_principal.Disabled", "value": "[parameters('aadServicePrincipalLogDisabled')]" }, @@ -399,7 +399,7 @@ "value": "[parameters('diagnosticsSourceType')]" }, { - "name": "AzureWebJobs.diatnostic-logs.Disabled", + "name": "AzureWebJobs.diagnostic_logs.Disabled", "value": "[parameters('diagnosticsDisabled')]" }, diff --git a/event-hubs-hec/diagnostic-logs/function.json b/event-hubs-hec/diagnostic_logs/function.json similarity index 100% rename from event-hubs-hec/diagnostic-logs/function.json rename to event-hubs-hec/diagnostic_logs/function.json diff --git a/event-hubs-hec/diagnostic-logs/index.js b/event-hubs-hec/diagnostic_logs/index.js similarity index 97% rename from event-hubs-hec/diagnostic-logs/index.js rename to event-hubs-hec/diagnostic_logs/index.js index 6eba9d3..7fccf0b 100644 --- a/event-hubs-hec/diagnostic-logs/index.js +++ b/event-hubs-hec/diagnostic_logs/index.js @@ -1,30 +1,30 @@ -/* -Copyright 2020 Splunk Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -const splunk = require('../helpers/splunk'); -module.exports = async function (context, eventHubMessages) { - - for (const event of eventHubMessages) { - await splunk - .sendToHEC(event, process.env["DIAGNOSTIC_LOG_SOURCETYPE"]) - .catch(err => { - context.log.error(`Error posting to Splunk HTTP Event Collector: ${err}`); - - // If the event was not successfully sent to Splunk, drop the event in a storage blob - context.bindings.outputBlob = event; - }) - } - context.done(); +/* +Copyright 2020 Splunk Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +const splunk = require('../helpers/splunk'); +module.exports = async function (context, eventHubMessages) { + + for (const event of eventHubMessages) { + await splunk + .sendToHEC(event, process.env["DIAGNOSTIC_LOG_SOURCETYPE"]) + .catch(err => { + context.log.error(`Error posting to Splunk HTTP Event Collector: ${err}`); + + // If the event was not successfully sent to Splunk, drop the event in a storage blob + context.bindings.outputBlob = event; + }) + } + context.done(); }; \ No newline at end of file