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

appmodel: fix oneliner steps being ignored #535

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MrAnno
Copy link
Member

@MrAnno MrAnno commented Mar 3, 2025

For example,

  step [sname] { $MESSAGE += " bello"; };

generated (transforms it into a comment):

  # step: sname         $MESSAGE += " bello";

@MrAnno MrAnno changed the title appmodel: fix onliner steps being ignored appmodel: fix oneliner steps being ignored Mar 3, 2025
For example,
  step [sname] { $MESSAGE += " bello"; };

generated:
  # step: sname         $MESSAGE += " bello";

Signed-off-by: László Várady <[email protected]>
Signed-off-by: shifter <[email protected]>
@MrAnno MrAnno force-pushed the fix-app-transform-comment branch from 456692c to f40544b Compare March 3, 2025 14:19
@@ -105,7 +105,7 @@ _generate_steps(AppTransformGenerator *self, GList *steps)
for (GList *l = steps; l; l = l->next)
{
TransformStep *step = l->data;
g_string_append_printf(self->block, " # step: %s", step->name);
g_string_append_printf(self->block, " # step: %s\n", step->name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just double check if location tracking still works properly

Copy link
Member Author

@MrAnno MrAnno Mar 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully understand what you mean.

Errors are reported as before (line numbers within the transformation are incorrect, but that's not because of my patch):

Error parsing filterx expression: syntax error, unexpected KW_BREAK, expecting ';'

In parser generator app-transform:14:9-14:14:
9
10      #Start Application trans
11          case 'trans':
12              # step: sname
13               idfj
14---->         break;
14---->         ^^^^^
15
16      #End Application trans
17              }
18          };
19      }

Included from /home/anno/dev/x/syslog/install/etc/syslog-ng.conf:42:5-42:65:
37          filterx {
38              declare appname = "trans";
39          };
40
41          parser { app-parser(topic(tttopic));
42---->     app-transform(filterx-app-variable(appname) flavour(ttopic)); };
42---->     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43
44          destination { stdout(); };
45      };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants