How to modify the value of exported variable in logtash file

I have one variable in shell script and exported it and I want to increase( by 1) the value of this variable in filter block of logstash file .

I have one variable in shell script (ksh file)
export f=0

logstash file
f += 1

it's not increased.
It would be very helpful if someone looks into it.

What you're trying to do just won't work. What underlying problem are you trying to solve? Without background information we won't be able to make any suggestions.

simply I have exported one variable(flag) in ksh file and intialized by 0.

ksh file
export flag = 0

now I want to increase the value of flag in filter block of logstash file ..
because in fliter block I have one condition.

logstash file
filter
{
ruby {
code => "
if flag == 0
puts 'one time execution.
end

flag +=1

"
}
}

conclusion is we need to print (puts 'one time execution.) statement once.

hope I explained in better way.

conclusion is we need to print (puts 'one time execution.) statement once.

Why? What end goal are you trying to reach?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.