相关文章推荐
闯红灯的泡面  ·  ole2notofficexmlfileex ...·  2 周前    · 
谦和的乌冬面  ·  java Tuple ...·  2 周前    · 
儒雅的太阳  ·  spring ...·  11 月前    · 
帅呆的小马驹  ·  delphi ...·  1 年前    · 
年轻有为的烤地瓜  ·  Cannot access ...·  1 年前    · 
气宇轩昂的铅笔  ·  Python-pptx ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Using the RouteOnAttribute processor to route on ListenSyslog processors, written attribute 'syslog.hostname'

Ask Question

I've successfully created a flow that uses the processors ListenSyslog and PutFile to capture syslog messages and write them to a file on disk.

I would however like to be able to use the RouteOnAttribute processor to route these incoming syslog messages using the source IP of the syslog message. The ListenSyslog processor info page lists that it writes attributes "syslog.hostname - The hostname or IP address of the Syslog message" I want to use this attribute in my RouteOnAttribute processor.

I'am unclear on how to access the written attributes of the ListenSyslog processor from within the RouteOnAttribute processor configuration properties to achieve this.

every attribut can be access with this syntax : ${my_attribut} .

in your case : ${syslog.hostname}

I suggest you to look at expression language if you want to use routeOnAttribut processor :

https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html

Thanks! I've tried using the expression ${syslog.hostname:contrains('one_of_my_source_ips')} using the route to matched if any strategy but I am not seeing any matches. Is there a way (using some processor) to extract the values of ${syslog.hostname} and write just those values to disk or a file so that I can create a list of the incoming source ip addresses? iron3rd Feb 23, 2020 at 11:49 you can use LogMessage processor for exemple: nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/… with ${syslog.hostname} , if it's just for debugging, you can look at attribut of flowfile wile they are in queue. maxime G Feb 23, 2020 at 12:11

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .