Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Hostname Parameter to be provided as a PipelineParameter by Property Name #29

Open
jberkers42 opened this issue Oct 27, 2022 · 1 comment
Assignees

Comments

@jberkers42
Copy link

Is your feature request related to a problem? Please describe.
I have a requirement to process some log data and send it on via Syslog, however, the log data itself contains the hostname, rather than being the same for all calls of the Send-SyslogMesssage. With the Hostname parameter not being considered as a Pipeline Parameter, the code would become more complex.

Describe the solution you'd like
It would be great if the Hostname Parameter could be supplied in the Pipeline by Property Name.

Examples of how the solution would work

Convert-LogFile is an example function, that outputs PSObject with Message, Timestamp and Hostname.

$SyslogParameters = @{
  Server = '192.168.1.1'
  Severity = 'Informational'
  Facility = 'local1'
  Port = '514'
  Transport = 'UDP'
  ApplicationName = '-'
  FramingMethod = 'Non-Transparent-Framing'
}

Convert-LogFile -Path 'sample.log' | Send-SyslogMessage @SyslogParameters -RFC3164

Describe alternatives you've considered
An alternate method would be to assign the results of the Convert-LogFile to a variable, and loop through the values (100's or potentially 1000's), calling Send-SyslogMessage with it's values.

Additional context
The Hostname value is needed by my target SIEM system to be able to extract the originating host from the Syslog Relay header.

@kjacobsen
Copy link
Member

Hey @jberkers42,

I can't see any problems with switching this. I will do some testing and get back to you when it is published.

@kjacobsen kjacobsen self-assigned this Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants