Hi Mezam,
In any case the Log Output filters just generates a ${data.xxx} based on the result of your step/script (and that is the variable that you need on the next steps), that variable name is defined in the Data Capture “Name Data” textbox. If you want to use it on inline-script use the @data.xxx@ format.
So, it works in the following way: the command/script generates a result, then the filter gets that result and save it on a ${data.xxx} variable.
I made an basic example that I tested locally. Just a tip: If you want to capture a data step, the best way is to “attach” the filter on the step (not globally).Check the example:
ultTab: nodes
description: ''
executionEnabled: true
id: 76b79511-1346-4ab5-9d1b-27c3cf45220b
loglevel: INFO
name: Servers Last Reboot Test
nodeFilterEditable: false
plugins:
ExecutionLifecycle: null
scheduleEnabled: true
sequence:
commands:
- description: Gathering Server Last Reboot Time
fileExtension: .ps1
interpreterArgsQuoted: false
plugins:
LogFilter:
- config:
captureMultipleKeysValues: 'true'
hideOutput: 'false'
logData: 'true'
name: myreport
regex: (.*)
type: key-value-data-multilines
script: |
$report = @()
$dump = "" | Select-Object 'ServerName', "LastBoot"
$dump.ServerName = [System.Net.Dns]::GetHostByName($env:computername).HostName
$dump.LastBoot = Get-CimInstance -ClassName win32_operatingsystem | Select-Object -expandproperty lastbootuptime
$report += $dump
$report
scriptInterpreter: powershell.exe
- fileExtension: .ps1
interpreterArgsQuoted: false
script: echo "@data.myreport@"
scriptInterpreter: powershell.exe
keepgoing: false
strategy: node-first
uuid: 76b79511-1346-4ab5-9d1b-27c3cf45220b
Check the result.
Also, I made some changes in my example (I used the “powershell.exe” interpreter instead of “PowerShell”, “.ps1” instead of Ps1).
You can see more complex/interesting Multiline Data Capture Pilter plugin examples here.
Hope it helps!