Rsyslog : wrong properties with reverse tunnel - reverse

better if i show an example:
original message, from host-A
{"#timestamp":"xxxxxxx","#version":"1","sysloghost":"host-A","severity":"xxxxxxx","facility":"xxxxxxx","programname":"host-A-app","procid":"xxxxxxx","relayhost":"host-A","relayip":"host-A","message": {xxxxxxx}}}}
message after reverse tunnel
{"#timestamp":"yyyyyyy","#version":"1","sysloghost":"localhost","severity":"notice","facility":"user","programname":"","procid":"-","relayhost":"localhost","relayip":"127.0.0.1","message":{"#timestamp":"xxxxxxx","#version":"1","sysloghost":"host-A","severity":"xxxxxxx","facility":"xxxxxxx","programname":"host-A-app","procid":"xxxxxxx","relayhost":"host-A","relayip":"host-A","message": {xxxxxxx}}}}
as you can see, properties have been replaced (original content is now the value of 'message' property).
I could extract original properties with some RegExp, or text searching, but i think should be a way to keep the original values.
Anyone, help?

I did more googling and found this https://gist.github.com/marshyon/583f75d35e45a6075ed1#file-server-rsyslog-conf-with-reverse-ssh-tunnel
Basically, dedicated ports, one for each host.
I wonder if there are more solutions ...

Related

How to interpret tcl command in openOCD manual

I'm completely new to tcl and am trying to understand how to script the command "adapter usb location" in openOCD.
From the openOCD manual, the command has this description:
I want to point it to the port with the red arrow below:
Thanks.
It's not 100% clear, but I would expect (from that snippet of documentation) a bus location to be a dotted “path” something like:
1-6
where the values are:
1 — Bus ID
6 — Port ID
Which would result in a call to the command being done like this:
adapter usb location 1-6
When there's a more complex structure involved (internally because of chained hubs) such as with the item above the one you pointed at, I'd instead expect:
1-5.3
Notice that there are is a sequence of port IDs (5.3) in there to represent the structure. The resulting call would then be:
adapter usb location 1-5.3
Now for the caveats!
I can't tell what the actual format of those IDs is. They might just be numbers, or they might have some textual prefix (e.g., bus1-port6). Those text prefixes, if present, might contain a space (or other metacharacter) which will be deeply annoying to use if true. You should be able to run adapter usb location without any other arguments to see what the current location is; be aware though that it might return the empty string (or give an error) if there is no current location. I welcome feedback on this, as that information appears to be not present in any online documentation I can find (and I don't have things installed so I can't just check).
I also have no idea what (if anything) to do with the device and interface IDs.

Liquibase - Trim whitespaces from CSV

I have a formatted CSV file for <loadData .../> of Liquibase.
There are some whitespaces for having a nice look.
But because of that whitespaces, I have wrong data in my DB.
How to solve it? Is there any "flag" or something for forcing Liquibase to trim whitespaces?
I tried to make it looking something like the next
id;name ;surname
1 ;test123;test123
2 ;test1 ;test123
3 ;"test" ;test123
Anyway, my DB contains test1__ and test"_ as well where _ is a space.
Also quotchar=""" didn't help (and it was expected, it is a redundant line).
Btw, id column which is defined as numeric - ok (1,2,3, etc with no errors).
Check out this Jira issue.
To quote Nathan Voxland:
It probably makes sense to keep the default as trimming since I think
that will cause less surprises. However, I added a global
configuration flag that lets you change the default.
You can set it either through a liquibase.trimCsvWhitespace=false
system property or by using the
LiquibaseConfiguration.getInstance().getProperty(GlobalConfiguration.class,
GlobalConfiguration.CSV_TRIM_WHITESPACE).setValue() API call.
Try adding liquibase.trimCsvWhitespace=falseproperty.
On further review, it looks like it was a change just in 3.5.0. I
usually try to keep backwards compatibility, even when it is
unexpected behavior but was thinking it had changed with 3.4.0 and so
changing it back to preserving whitespace would break other people
that are now expecting it to be trimming.
However, since it did change unexpectedly in 3.5.0 only, it is
definitely a bug and so I'm just setting the logic back to preserving
whitespace.
Accodring to Jira ticket this bug was fixed in liquibase version 3.5.1, but looks like it actually wasn't.

regular expressions solution, Trouble accessing a previously easy to access nba STATS url

This might be slightly off topic, but since the solution is a general expressions problem I thought it could be interesting to solve it here.
I am trying to access a URL that has data that I usually scrape for Analysis:
http://stats.nba.com/stats/shotchartdetail?CFID=33&CFPARAMS=2011-12&ContextFilter=&ContextMeasure=FGA&DateFrom=&DateTo=&GameID=&GameSegment=&LastNGames=0&LeagueID=00&Location=&MeasureType=Base&Month=0&OpponentTeamID=0&Outcome=&PaceAdjust=N&PerMode=PerGame&Period=0&PlayerID=0&PlusMinus=N&Position=&Rank=N&RookieYear=&Season=2011-12&SeasonSegment=&SeasonType=Regular+Season&TeamID=0&VsConference=&VsDivision=&mode=Advanced&showDetails=0&showShots=1&showZones=0
As you can see in the url it has many fields to be filled, and this url that previously worked now it gives me the following error:
The PlayerPosition property is required.
So I thought that as in many other fields in the URL if I added
&PlayerPosition=0
It would use every position, so I used this url:
http://stats.nba.com/stats/shotchartdetail?CFID=33&CFPARAMS=2011-12&ContextFilter=&ContextMeasure=FGA&DateFrom=&DateTo=&GameID=&GameSegment=&LastNGames=0&LeagueID=00&Location=&MeasureType=Base&Month=0&OpponentTeamID=0&Outcome=&PaceAdjust=N&PerMode=PerGame&Period=0&PlayerID=0&PlusMinus=N&Position=&Rank=N&RookieYear=&Season=2011-12&SeasonSegment=&SeasonType=Regular+Season&TeamID=0&VsConference=&VsDivision=&mode=Advanced&showDetails=0&showShots=1&showZones=0&PlayerPosition=0
But it gave me the following error:
The field PlayerPosition must match the regular expression '^((Guard)|(Center)|(Forward))?$'.
So I tried replacing &PlayerPosition=0 to:
&PlayerPosition=&PlayerPosition='^((Guard)|(Center)|(Forward))?$'
&PlayerPosition=&PlayerPosition= ^((Guard)|(Center)|(Forward))?$
&PlayerPosition=&PlayerPosition=((Guard)|(Center)|(Forward))?
&PlayerPosition=&PlayerPosition=((Guard)|(Center)|(Forward))
But nothing worked, and it gives me back the same error, any suggestions?
Player position should match against this regex:
'^((Guard)|(Center)|(Forward))?$'
the ()? states that everything between the parentheses is optional. So, (Guard)|(Center)|(Forward) is optional. It can be blank.
Meaning that the following values are all valid:
PlayerPosition=Guard
PlayerPosition=Center
PlayerPosition=Forward
PlayerPosition=
I've tried in the browser using it without anything after it and it worked:
http://stats.nba.com/stats/shotchartdetail?CFID=33&CFPARAMS=2011-12&ContextFilter=&ContextMeasure=FGA&DateFrom=&DateTo=&GameID=&GameSegment=&LastNGames=0&LeagueID=00&Location=&MeasureType=Base&Month=0&OpponentTeamID=0&Outcome=&PaceAdjust=N&PerMode=PerGame&Period=0&PlayerID=0&PlusMinus=N&Position=&Rank=N&RookieYear=&Season=2011-12&SeasonSegment=&SeasonType=Regular+Season&TeamID=0&VsConference=&VsDivision=&mode=Advanced&showDetails=0&showShots=1&showZones=0&PlayerPosition=
Add the parameter PlayerPosition your url string, where ever you want. But value can be "Guard" or "Center" or "Forward" only.
for example
http://stats.nba.com/stats/shotchartdetail?CFID=33&CFPARAMS=2011-12
&ContextFilter=&ContextMeasure=FGA&DateFrom=&DateTo=&GameID=&GameSegment=
&LastNGames=0&LeagueID=00&Location=&MeasureType=Base&Month=0
&OpponentTeamID=0&Outcome=&PaceAdjust=N&PerMode=PerGame
&Period=0&PlayerID=0&PlusMinus=N&Position=&Rank=N&RookieYear=
&Season=2011-12&SeasonSegment=&SeasonType=Regular+Season&TeamID=0
&VsConference=&VsDivision=&mode=Advanced&showDetails=0&showShots=1
&showZones=0
&PlayerPosition=Guard

Search for id="* *" in Eclipse

I am searching in my Eclipse project for id="* *" in order to find something like below in all files of my project
id="Text1 Text2"
Since space between attribute value needs to be removed I am searching like this to find out all the instances in my project.
But it searches and brings up lots of results since * represent any string.
For example:
id="xyzImg" onLoad="test();" SRC="abc.png"
It taking the complete element instead of desired results.
Please suggest me is there any way to get my desired result or is there any online tool that serve the same purpose.
I am going to write it here as an answer instead. Try with *|*. By asterisk I meant the wildcard symbol.

Three rows of almost the same code behave differently

I have three dropdown boxes on a Main_Form. I will add the chosen content into three fields on the form, Form_Applications.
These three lines are added :
Form_Applications.Classification = Form_Main_Form.Combo43.Value
Form_Applications.Countryname_Cluster = Form_Main_Form.Combo56.Value
Form_Applications.Application = Form_Main_Form.Combo64.Value
The first two work perfectly but the last one gives error code 438!
I can enter in the immediate window :
Form_Applications.Classification = "what ever"
Form_Applications.Countryname_Cluster = "what ever"
but not for the third line. Then, after enter, the Object doesn't support this property or method error appears.
I didn't expect this error as I do exactly the same as in the first two lines.
Can you please help or do you need more info ?
In VBA Application is a special word and should not be used to address fields.
FormName.Application will return an object that points to the application instance that is running that form as opposed to an object within that form.
From the Application object you can do all sorts of other things such as executing external programs and other application level stuff like saving files/
Rename your Application field to something else, perhaps ApplicationCombo and change your line of code to match the new name. After doing this the code should execute as you expect.
Form_Applications.Application is referring to the application itself. It is not a field, so therefore it is not assignable (at least with a string).
You really haven't provided enough code to draw any real conclusions though. But looking at what you have posted, you definitely need to rethink your approach.
It's to say definitely but you are not doing the same. It looks like you are reading a ComboBox value the same (I will assume Combo64 is the same as 43 and 56) but my guess is that what you are assigning that value to is the problem:
Form_Applications.Application =
Application is not assignable. Is there another field you meant to use there?